🔒 Closed Patulong po dito sa applet coding ko di po kasi mag divide

Status
Not open for further replies.

euls020

Enthusiast
Patulong po dito sa applet coding ko di po kasi mag divide. ty po. ayaw po gumawa yung divide 4 may mali po ba dito. ang nalabas kase sa halip na 91 nagiging 295. di ko po alam kung bakit kung hindi naman po nagana yung divide dapat 364 po sagot. ano po ba mali.

public void actionPerformed(ActionEvent objEvent){
int ave=0;
if(objEvent.getSource()==cmdCalculate)
{
ave=Integer.parseInt(txtProgramming.getText())+Integer.parseInt(txtDatabase.getText())+Integer.parseInt(txtPhilosophy.getText())+Integer.parseInt(txtLiterature.getText())/4;
txtGeneralAverage.setText(String.valueOf(ave));
 
nagawa ko na sir. salamat po sa tulong. medyo pinahaba ko lang po tas tumama sir. salamat.
public void actionPerformed(ActionEvent objEvent){
int total=0;
if(objEvent.getSource()==cmdCalculate)
{
int num1 = Integer.parseInt(txtProgramming.getText());
int num2 = Integer.parseInt(txtDatabase.getText());
int num3 = Integer.parseInt(txtPhilosophy.getText());
int num4 = Integer.parseInt(txtLiterature.getText());

int answer= num1 + num2 + num3 + num4;
total= answer/4;
txtGeneralAverage.setText(String.valueOf(total));
}
}
}
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 728
    Views
  • 2
    Participants
Last reply from:
euls020

Trending Topics

Online now

Members online
1,070
Guests online
1,561
Total visitors
2,631

Forum statistics

Threads
2,285,485
Posts
29,030,575
Members
1,218,489
Latest member
fritz91
Back
Top