Vous êtes sur la page 1sur 5

Assumptions:

1.The grade is both a double while being referred to as a letter


grade
2. Course numbers refer back to grade number
3. import javax.swing.JOptionPane
4. The GUI and output will take and output a number with one
decimal point and letter grade.
Unnecessary knowledge
1. you dont need to know how works by printing in a GUI.
public void set the Letter grade ()
{
if(grade is greater than or equal to 97.0 and less than or equal to
100.0)
{
return A+;
}
if(grade is less than or equal to 96.9 and greater than or equal to
94.0)
{
return A;
}
if(grade is less than or equal to 93.9 and greater than or equal to
90.0)
{
return A-;
}
if(grade is less than or equal to 89.9 and greater than or equal to
87.0)
{
return B+;
}
if(grade is less than or equal to 86.9 and greater than or equal to

84.0)
{
return B;
}
if(grade is less than or equal to 83.9 and greater than or equal to
80.0)
{
return B-;
}
if(grade is less than or equal to 79.9 and greater than or equal to
79.9)
{
return C+;
}
if(grade is less than or equal to 78.9 and greater than or equal to
76.0)
{
return C;
}
if(grade is less than or equal to 75.9 and greater than or equal to
75.0)
{
return C-;
}
if(grade is less than or equal to 74.9 and greater than or equal to
74.0)
{
return D+;
}
if(grade is less than or equal to 73.9 and greater than or equal to
71.0)
{
return D;
}
if(grade is less than or equal to 70.9 and greater than or equal to
70.0)
{

return D-;
}
if(grade is less than 70.0 and greater than 0.0)
{
return F;
}
return null;
}
public void make the console look pretty ()
{
print(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx);
println("\n\n\n");
println("\n\nThomas Watson\t\t\tGrade:\t10");
println("\n--------------------------------------------------);
}

//code in the main of another class


Report Card = new object of Report();
Card calls makePretty();
grade1 = a double (JOptionPane.showInputDialog(Enter your
Spansh grade );
Card calls findLetterGrade(uses grade1);
println(course1+"\t\t\t\t\t"+Card.findLetGrade(grade1));
grade2=a double(JOptionPane.showInputDialog("Enter
your Theology grade "));
Card calls findLetGrade(uses grade2);
println(course2+"\t\t\t\t\t\t"+Card calls findLetGrade(grade2));
grade3=a double(JOptionPane.showInputDialog("Enter
your US History grade "));
Card calls findLetGrade(use grade3);
println(course3+"\t\t\t\t\t\t"+Card calls findLetGrade(grade3));

grade4=a double(JOptionPane.showInputDialog("Enter your


Geometry grade "));
Card calls findLetGrade(use grade4);
println(course4+"\t\t\t\t\t"+Card calls findLetGrade(grade4));

grade5=Double.parseDouble(JOptionPane.showInputDialog("
Enter your Chemistry grade "));
Card calls findLetGrade(use grade5);
println(course5+"\t\t\t\t\t"+Card calls findLetGrade(grade5));

grade6=a double(JOptionPane.showInputDialog("Enter
your Computer Science grade "));
Card calls findLetGrade(use grade6);
println(course6+"\t\t\t\t\t\t"+Card calls
findLetGrade(grade6));

grade7=Double.parseDouble(JOptionPane.showInputDialo
g("Enter your English grade "));
Card calls findLetGrade(use grade7);
println(course7+"\t\t\t\t\t\t"+Card calls
findLetGrade(grade7));
JOptionPane.showMessageDialog(null,course1+" "+Card
calls findLetGrade(grade1)+"
"+grade1+"\n"+course2+" "+Card calls
findLetGrade(grade2)+" "+grade2+"\n"+course3+" "+Card
calls findLetGrade(grade3)+" "+grade3+"\n"+course4+" "+Card
calls findLetGrade(grade4)+"
"+grade4+"\n"+course5+" "+Card calls

findLetGrade(grade5)+" "+grade5+"\n"+course6+"
calls findLetGrade(grade6)+"
"+grade6+"\n"+course7+" "+Card calls
findLetGrade(grade7)+" "+grade7);
}
}

"+Card

Vous aimerez peut-être aussi