Question: 5.1 Question 1 Create a package named Q1. Create a java class named Student according to Student the UML diagram. -name: String Specifications for the

5.1 Question 1 Create a package named Q1. Create a java class named Student according to Student the UML diagram. -name: String Specifications for the Student class -student Number: int -score: int Constructor without arguments - will assign all field values based on the information +Student() pertaining to a fictional character of your +Studenti nm: String, sNum: int, sc: int) choice. +getinfo(): void Constructor with 3 arguments - will assign all +getName(): String field values based on the information passed in getScore(): int the arguments. +getLetterGrade(): String o getInfo() method prints out the three field values separated by fixed tab spacing ("\t"). For example: John Doe 111222 87 Note: Use any print method of your choice. The accessor/getter method getName() returns the student's full name the first name followed by a space followed by the last name), while getScore() returns the score of a student o Member method called getLetterGrade() will return the letter grade according to the table given at the end. In the same Java package, create a new driver class with the name StudentGrades By Your FirstName Specifications for the driver class o Inside the main method, call printHeader(). o First student: Declare a Student type reference variable and instantiate it to create an object with the help of the constructor without argument. Second student: Declare another Student type reference variable and instantiate it using the constructor with three arguments. Choose your own values here. o Print the information for the first student. Print his/her/their letter grade. o Print the information for the second student. Print his/her/their letter grade. o Compare the scores and display which student scored higher. Note: Use any print method of your choice. Assumption: score will always be between 0 and 100. No validation required. Hint: You must use if-else-if statements. See resources. o Week 6 -> Unit 5 (brief version) (slide 20-23) IntelliJ: Working with If-statements and some Short-cut techniques. Sample output: Letter Grade Score 90 or greater 80-89 A+ Your Full Name Lab #?, Question #? Here is my information: ======== Harry Potter 211900 Letter grade C+ Ron Weasly 217777 Letter grade A- 50 70-79 60-69 A- B+ B- 87 C+ 50-59 40-49 Ron scored higher than Harry! D 30-39 29 or less *** Goodbye from yourFullName *** F
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
