Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Problem Specification For this programming assignment, you will be completing the implementation of a java program for storing the grades of students in a

1 Problem Specification
For this programming assignment, you will be completing the implementation of a java program for storing the grades of students in a java.util.ArrayList and calculating/presenting some statistics of grades.
To do this, you will complete the implementation of the following classes (the incomplete classes are available on Canvas and stored in PA1 Draft.zip).
public class Grade: keeps a single grade in the form of both score (from 0 to 100) and letter grade (A, A-,..., F). The assumption is that the letter-grade cut-off points are the same as you see in the course syllabus.
public class Student: keeps track of students info: first name (String), last name (String),7-digit ID (int), and grade (Grade).
public class Gradebook: keeps a list of students info in the following data structure: java.util.ArrayListStudent.
public class Main: contains the main method which does the followings: first it gets users input data from System.in verifies the data to make sure there is no problem with the input data. Then, it asks for users commands and gets them via System.in. Finally, it processes each command, and outputs the results to System.out.
2. Program Input Handling Phase
The program must first ask the user to enter the information of the first student via keyboard by printing the following message:
Welcome to my grade book!
Please enter the information of the first student using the following format: firstName lastName PID grade.
Press Enter when you are done.
After user enters the requested information (e.g.Ann Smith 123456793), the program must repetitively ask for information of the next student by printing the following message in a while loop:
Please enter the information of the next student using the same format. If there is no more students, please enter the keyword DONE.Press Enter when you are done.
The user input must meet the following criteria. If any of these criteria are not satisfied, the program must ask the user to try again:
firstName is a single word which contains alphabetical characters only, starts with a capital letter and does not include any white space character.
lastName is a single word which contains alphabetical characters only, starts with a capital letter and does not include any white space character. lastName may contain at-most one dot (.) character too.
PID is a seven digit integer with no leading zeros.
grade is a non-negative integer that doesnt exceed 100.
3. Program Command Handling Phase
After the user enters the information of all students one-by-one and enters the keyword DONE, your program must keep asking for a new command (e.g. print the message Please enter a new command) and respond to each command properly. Here are the list of all commands that your program must support:
min score: Your program must calculate and print the minimum score of all students as the response to this command.
min letter: Your program must calculate and print the minimum letter-grade of all students as the response to this command.
max score: Your program must calculate and print the maximum score of all students as the response to this command.
max letter: Your program must calculate and print the maximum letter-grade of all students as the response to this command.
letter XXXXXXX : Your program must find and print the letter-grade of the student whose PID is given by the command (XXXXXXX is the PID where each X represents a digit).
name XXXXXXX: Your program must find and print the full name of the student whose PID is given by the command (XXXXXXX is the PID where each X represents a digit). Full name is made of first name, followed by a single white space and the last name.
change XXXXXXX YY : Your program must find and update the grade of the student whose PID is given by the command (XXXXXXX is the PID where each X represents a digit). Int this command, YY is the symbol for the new grade.
average score: Your program must calculate and print the average score (out of 100) of all students as the response to this command.
average letter: Your program must calculate and print the letter-grade of average score of all students as the response to this command.
median score: Your program must calculate and print the median score of all students as the response to this command.
median letter: Your program must calculate and print the letter-grade of median score of all students as the response to this command.
tab scores: Your program must print the list of all students in the form of a tab- separated table containing four columns with labels first name, last name, PID, and score.
tab letters: Your program must print the list of all students in the form of a tab- separated table containing four columns with labels first name, last name, PID, and letter-grades.
quit: Your program must stop asking for more commands and quit.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Show that as n ? ? (a) 1(1 - ).-(1 (b) (1 - )" - . (e) (1-) -1

Answered: 1 week ago

Question

5. Identify and describe nine social and cultural identities.

Answered: 1 week ago

Question

2. Define identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago