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.ArrayList(Student).
public class Main: contains the main method which does the followings: first it gets
user's input data from
System.in verifies the data to make sure there is no problem
with the input data. Then, it asks for user's commands and gets them via System. in.
Finally, it processes each command, and outputs the results to System.out.
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 ') character too.
PID is a seven digit integer with no leading zeros.
grade is a non-negative integer that doesn't exceed 100.
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 representsmax 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 xxxxxxxYY : 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 soore: 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 colum
image text in transcribed

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions