Question
Develop a class called GradeBook.java to collect course information and grades from user and generate a nicely formatted report; The class GradeBook have only one
Develop a class called GradeBook.java to collect course information and grades from user and generate a nicely formatted report;
The class GradeBook have only one main method;
Collect information for two courses and collect the following information for each of them:
String courseName;
int creditHour;
double percentGrade;
Add number after the variable names to differentiate between two courses: courseName1, courseName2 for example;
Course name may include spaces;
The program will do the following jobs:
Ask user to input course 1 information and grade;
Ask user to input course 2 information and grade;
Assume the course name will be less than 20 characters wide;
Assume the credit hour will be less than 2 characters wide;
Assume user will input the correct value, and no validation need;
Print collected information in a tabula format.
Course name left justified and should be 20 characters wide excluding the two extra wrapping spaces;
Credit hours and percent grades right justified and should be 5 and 6 characters wide excluding the two extra wrapping spaces;
Add javadoc to your class;
Sample input / output (the values of course name, credit hours and grades are inputs):
Course 1: Course Name: Java programing Credit hours: 3 Percent grade: 94.5 Course 2: Course Name: Python programming Credit hours: 3 Percent grade: 89 ----------------------------------------- | Course Name | Hours | Grade | ----------------------------------------- | Java programming | 3 | 94.50 | | Python programming | 3 | 89.00 | -----------------------------------------
Tips and hints:
Make use of extra nextLine() methods to avoid reading in empty string if it a nextLine() is right after next, nextInt and nextDouble;
Course name will include spaces. Which Scanner class method should be used?
You have to use printf method to format the output; Be careful of whitespace characters;
Experiment with your output and make them align well.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started