the implementation of a java program for storing the grades of students in a java.util.ArrayList and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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: "first Name lastName PID grade". Press Enter when you are done. After user enters the requested information (e.g. "Ann Smith 1234567 93"), 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 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 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. 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. 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: "first Name lastName PID grade". Press Enter when you are done. After user enters the requested information (e.g. "Ann Smith 1234567 93"), 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 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 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.
Expert Answer:
Answer rating: 100% (QA)
To handle user input you can use the Scanner class in Java Here is an example code for the input han... View the full answer
Related Book For
Principles Of Managerial Statistics And Data Science
ISBN: 9781119486411
1st Edition
Authors: Roberto Rivera
Posted Date:
Students also viewed these programming questions
-
Briefly describe the development of patriarchal social systems in Western societies. What social situation or problem do you think patriarchy was engineered to resolve ?
-
You have been employed to create program to assist the manager of a coffee shop. You decide to make a prototype application in Java to show what you can do, and to be able to ask the manager what...
-
Do some amendment and enhance the given research paper: Table of Content Abstract..3 Action Research.4 Research Methodology and Design...5 Literature Review: NoSQL Database7 Proposal.7 Iteration 1..8...
-
Explain why the coffee shop manager should measure elasticity using the mid-point method in his calculations.
-
Suppose Morrison Corp.s breakeven point is revenues of $1,100,000. Fixed costs are $660,000. Required 1. Compute the contribution margin percentage. 2. Compute the selling price if variable costs are...
-
Let \(\tilde{z}, \tilde{x}\) and \(\tilde{y}\) be three random variables. Show that \(\tilde{z}\) is a sufficient statistic for the conditional density \(f(y, z \mid x)\) if and only if the...
-
Following is the cash book (bank columns) of E Flynn for December 19X7: You are required to: (a) Write the cash book up to date to take the necessary items into account, and (6) Draw up a bank...
-
The following audit procedures are included in the audit program because of heightened risks of material misstatements due to fraud. 1. Use audit software to search cash disbursement master files for...
-
Please answer the following question, Thanks!. Partnerships July 1, 2004: S. Kwon and E. Seo invest in a partnership. S. Kwon invests $6,000.00 cash, and equipment worth $8,000.00. He also has a...
-
Annie invested $5,000 in a segregated fund in a non-registered account. At that time, the basis of each unit was worth $10. At the end of the year, the fund made an allocation of $300 to Annie's...
-
A project costs $18,800 today.It will generate cash flows of $5,000 per year for six years.What is the project`s payback period?
-
Explain what arbitrageurs would do if the price of an American S\&P 500 futures call with an exercise price of 2,100 were priced at 45 when the underlying futures price was trading at 2,150. What...
-
Discuss the emergence of the species Homo erectus. Where are these fossils found? How old are they?
-
Where were the earliest hominids found? Describe the hominid Lucy.
-
Discuss the applicability of the pseudo-American model for pricing American call options.
-
Do you think it is possible to adopt a humanitarian standard that would be accepted by everyone in the world? What might this view entail?
-
https://www.journalofaccountancy.com/news/2011/jul/20114177.html Address the following questions based on the above article: What corporate finance problems are the articles addressing? What method...
-
Select a mass spectrometric technique with the highest mass resolution for identifying an unknown compound being eluted from a liquid chromatography column
-
Refer to Example 4.3. a) Show that the mean number of children for teenage females is 0.35. b) Show that the median number of children for teenage males is 0. Example 4.3 Suppose there is a community...
-
A computer company wishes to install a fan that cools the equipment so that the temperature of the mother-board does not exceed a 115F. A company inspector wishes to test the design of the computer...
-
Figure 3.10 shows age histograms by drivers race for moving violation stops in San Diego involving a search. The figure below displays the age histograms by drivers race for moving violation stops in...
-
Rewrite the solution to Problem 3 and identify the initial value Green's functions. Data from Problem 3 Find product solutions, \(u(x, t)=b(t) \phi(x)\), to the wave equation satisfying the boundary...
-
Established less than 50 years ago, Honda Motor Co. Ltd. of Japan is a leading international manufacturer of automobiles and the largest manufacturer of motorcycles in the world. As a Japanese...
-
Rewrite the solution to Problem 2 and identify the initial value Green's function. Data from Problem 2 Find product solutions, \(u(x, t)=b(t) \phi(x)\), to the heat equation satisfying the boundary...
Study smarter with the SolutionInn App