Can Anyone Help??
I have this program which is listed below. I want to take the grades that the students have assigned to them, and assign the letter grades a numeric value so that I can calculate their GPA. I just have no idea how I am supposed to do that?? Can anyone HELP!!!
import javax.swing.*;
import java.util.*;
public class GradePoint
{
public static void main(String[] args)
{
String tempGrades;
String[][] names = new String[10][6];
String outputGrades = new String();
float gpa;
double A = 4;
double a = 4;
double B = 3;
double b = 3;
double C = 2;
double c = 2;
double D = 1;
double d = 1;
double F = 0;
double f = 0;
for(int x = 0; x < 3; x++)
{
names[x][0] = JOptionPane.sho wInputDialog(nu ll, "Please Enter Student number " + (x + 1) + "s Name ");
for(int y = 1; y < 6; y++)
{
do
tempGrades = JOptionPane.sho wInputDialog(nu ll, "Please Enter Grade for course number " + (y));
while (!tempGrades.eq ualsIgnoreCase( "A") && !tempGrades.equ alsIgnoreCase(" B") && !tempGrades.equ alsIgnoreCase(" C") && !tempGrades.equ alsIgnoreCase(" D") && !tempGrades.equ alsIgnoreCase(" F"));
names[x][y]=tempGrades;
}
}
for(int x = 0; x < 3; x++)
{
outputGrades = "Students Name " + names[x][0] + "\n";
for(int y = 1; y < 6; y++)
outputGrades += "Grade for course number " + y + ": " + names[x][y] + "\n";
JOptionPane.sho wMessageDialog( null, outputGrades);
JOptionPane.sho wMessageDialog( null, names[x][y]);
JOptionPane.sho wMessageDialog( null, "Grade Report Finished");
System.exit(0);
}
}
I have this program which is listed below. I want to take the grades that the students have assigned to them, and assign the letter grades a numeric value so that I can calculate their GPA. I just have no idea how I am supposed to do that?? Can anyone HELP!!!
import javax.swing.*;
import java.util.*;
public class GradePoint
{
public static void main(String[] args)
{
String tempGrades;
String[][] names = new String[10][6];
String outputGrades = new String();
float gpa;
double A = 4;
double a = 4;
double B = 3;
double b = 3;
double C = 2;
double c = 2;
double D = 1;
double d = 1;
double F = 0;
double f = 0;
for(int x = 0; x < 3; x++)
{
names[x][0] = JOptionPane.sho wInputDialog(nu ll, "Please Enter Student number " + (x + 1) + "s Name ");
for(int y = 1; y < 6; y++)
{
do
tempGrades = JOptionPane.sho wInputDialog(nu ll, "Please Enter Grade for course number " + (y));
while (!tempGrades.eq ualsIgnoreCase( "A") && !tempGrades.equ alsIgnoreCase(" B") && !tempGrades.equ alsIgnoreCase(" C") && !tempGrades.equ alsIgnoreCase(" D") && !tempGrades.equ alsIgnoreCase(" F"));
names[x][y]=tempGrades;
}
}
for(int x = 0; x < 3; x++)
{
outputGrades = "Students Name " + names[x][0] + "\n";
for(int y = 1; y < 6; y++)
outputGrades += "Grade for course number " + y + ": " + names[x][y] + "\n";
JOptionPane.sho wMessageDialog( null, outputGrades);
JOptionPane.sho wMessageDialog( null, names[x][y]);
JOptionPane.sho wMessageDialog( null, "Grade Report Finished");
System.exit(0);
}
}
Comment