ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 8.00

import javax.swing.JOptionPane

I cannot get it to display the grade when you enter a value of 0-100.  The dialogue box keeps looping with no end.  Please help with my java code below:

import javax.swing.JOptionPane;
public class GradeCalcDiao {

public static void main(String[] args)
{
String strYourGrade;
int NumberofGrades = 0;
int grade = 0;
int min = 100;
int max = 0;
double avg = 0;
int sum = 0;
int high = 0;
int low = 0;
int A,B,C,D,F;

A=0;
B=0;
C=0;
D=0;
F=0;

strYourGrade = JOptionPane.showInputDialog("Enter grades in range of 0 - 100");

while(true){

if(grade != -1){

sum = sum + grade;
}

else if(grade >= 0);


else if(grade >= 90 && grade 
JOptionPane.showMessageDialog(null, "Your grade is A");
}
else if(grade >= 80 && grade 
JOptionPane.showMessageDialog(null, "Your grade is B");
}
else if(grade >= 70 && grade 
JOptionPane.showMessageDialog(null, "Your grade is C");
}
else if(grade >= 60 && grade 
JOptionPane.showMessageDialog(null, "Your grade is D");
}
else if(grade >= 0 && grade 
JOptionPane.showMessageDialog(null, "Your grade is F");
}

else if(grade min = grade;
else if(grade > max)
max = grade;



}
}
}

Answers

(11)
Status NEW Posted 03 May 2017 03:05 AM My Price 8.00

-----------

Not Rated(0)