0% found this document useful (0 votes)
10 views2 pages

Text KH

This Java program implements a student registration system that allows a user to enter a student's information, record class grades for a student, and display a student's transcripts. The program uses arrays to store student information and class grades. A menu is displayed for the user to select entering new student data, recording grades, displaying transcripts, or quitting the program.

Uploaded by

phmfxdm8j8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Text KH

This Java program implements a student registration system that allows a user to enter a student's information, record class grades for a student, and display a student's transcripts. The program uses arrays to store student information and class grades. A menu is displayed for the user to select entering new student data, recording grades, displaying transcripts, or quitting the program.

Uploaded by

phmfxdm8j8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

Scanner;

public class StudentRegistrationSystem {


private static String[] studentInformation = new String[3];
private static String[][] classGrades = new String[3][3];

public static void main(String[] args) {


Scanner scanner = new Scanner(System.in);
char choice;

do {
System.out.println("STUDENT REGISTRATION SYSTEM");
System.out.println("A) Enter a student new information.");
System.out.println("B) Record a class grade for a student.");
System.out.println("C) Display transcripts for a student.");
System.out.println("Q) Quit");

System.out.print("(Enter your choice): ");


choice = scanner.next().charAt(0);

switch (choice) {
case 'A':
enterStudentInformation(scanner);
break;
case 'B':
recordClassGrade(scanner);
break;
case 'C':
displayTranscripts();
break;
case 'Q':
System.out.println("Exiting the system. Goodbye!");
break;
default:
System.out.println("Invalid choice. Please enter a valid
option.");
}
} while (choice != 'Q');
}

private static void enterStudentInformation(Scanner scanner) {


System.out.println("Enter student information:");
System.out.print("Name: ");
studentInformation[0] = scanner.next();
System.out.print("Phone Number: ");
studentInformation[1] = scanner.next();
System.out.print("University ID: ");
studentInformation[2] = scanner.next();
}

private static void recordClassGrade(Scanner scanner) {


System.out.println("Record class grade:");
for (int i = 0; i < 3; i++) {
System.out.print("Enter course code for course " + (i + 1) + ": ");
classGrades[i][0] = scanner.next();
System.out.print("Enter course name for course " + (i + 1) + ": ");
classGrades[i][1] = scanner.next();
System.out.print("Enter course grade for course " + (i + 1) + ": ");
classGrades[i][2] = scanner.next();
}
}

private static void displayTranscripts() {


System.out.println("Displaying transcripts...");
System.out.println("Student Information:");
System.out.println("Name: " + studentInformation[0]);
System.out.println("Phone Number: " + studentInformation[1]);
System.out.println("University ID: " + studentInformation[2]);

System.out.println("Class Grades:");
for (int i = 0; i < 3; i++) {
System.out.println("Course " + (i + 1) + ":");
System.out.println("Course Code: " + classGrades[i][0]);
System.out.println("Course Name: " + classGrades[i][1]);
System.out.println("Course grade: " + classGrades[i][2]);
}

}
}

You might also like