ms.sweetee
10-22-2007, 09:03 PM
hi...
i kinda need some help with a code
i need to code a transcript of students in java
could someone please help me out :confused:
thanks a lot
Khalid Ali
10-22-2007, 10:51 PM
many people can help, however first you need to explain what exactly you need help with.
ms.sweetee
10-22-2007, 11:15 PM
the thing is i ve got an assignment for school that i need to do and im kinda new to all this
so i need to write a complete Java application that will read in student information and print out a simple academic transcript via System.out
the application must do the following:
-read in (via JOptionPane)the number of students to be "processed"
continue promting the user until a value between 1 and 10(inclusive) is entered. assume characters entered are numeric so i kind of started this by doing a while loop, which looks something like this
while (students < 1 || students > 10) {
JOptionPane.showMessageDialog(null,"You entered an invalid number, the number of students should be between 1 and 10 (inclusive)!");
input =JOptionPane.showInputDialog ("Enter the number of students to be processed!");
students = Integer.parseInt (input);
}//closes while loop
the next thing is:
For each student to be processed:
o Read in (via JOptionPane) a student number and a student name. The format will consist of a 7-character student number followed directly by the name. For example, “1234567Doe, Jane”.
o Read in a course id and letter grade. The format will consist of an 8-character course id followed directly by the letter grade. For example, “COMP1010B+” or “COMP1010D”. The only valid letter grades to be allowed include “A+”, “A”, “B+”, “B”, “C+”, “C”, “D”, and “F”. Invalid letter grades should produce an appropriate error message displayed via JOptionPane; these error messages should not appear on the transcript. Course ids and letter grades will be entered until the user enters “EXIT”.
o For each course id and valid letter grade entered, print out a formatted line of output.
o When the user is finished entering course ids and valid letter grades for a student, the application will print out the numerical GPA. Letter grades will carry the following weights:
A+ 4.5
A 4.0
B+ 3.5
B 3.0
C+ 2.5
C 2.0
D 1.0
F 0.0
No error checking other than what is described above is required. For example, given the following input:
2 1234567Rubble, Barney
COMP1010A+
MATH1200B+
PHIL1650C
EXIT
7654321Flintstone, Fred
COMP2140A COMP2150B+ COMP2160A PHYS2220X PHYS2220Y PHYS2220Z PHYS2220B EXIT
The output produced should be similar to:
You will be processing 2 students.
Transcript for: Rubble, Barney 1234567
COMP1010 A+
MATH1200 B+
PHIL1650 C
GPA for Rubble, Barney: 3.33
Transcript for: Flintstone, Fred 7654321
COMP2140 A COMP2150 B+
COMP2160 A PHYS2220 B G
PA for Flintstone, Fred: 3.63
HOPE IT MAKES SENSE?
ID REALLY APRECIATE IT IF YOU COULD TELL ME THE RIGHT WAY TO DO IT.
THANKS