🔒 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
  • 724
    Views
  • 2
    Participants
Last reply from:
euls020

Online now

Members online
464
Guests online
865
Total visitors
1,329

Forum statistics

Threads
2,275,103
Posts
28,960,649
Members
1,233,594
Latest member
baam
Back
Top