0 évaluation0% ont trouvé ce document utile (0 vote)
42 vues2 pages
This document describes an assignment to create a student report card program. It involves taking input of student names and grades, creating Student objects with get/set methods for name and grade, and a method to convert the numerical grade to a letter grade. The Student objects will be stored in an array, sorted by grade, and the display text with name and letter grade will be output for each student.
This document describes an assignment to create a student report card program. It involves taking input of student names and grades, creating Student objects with get/set methods for name and grade, and a method to convert the numerical grade to a letter grade. The Student objects will be stored in an array, sorted by grade, and the display text with name and letter grade will be output for each student.
This document describes an assignment to create a student report card program. It involves taking input of student names and grades, creating Student objects with get/set methods for name and grade, and a method to convert the numerical grade to a letter grade. The Student objects will be stored in an array, sorted by grade, and the display text with name and letter grade will be output for each student.
Date of Submission: 8th Feb In this assignment, you will output a report card. Initially, you will take as input the number of students; after that, for each student, you will take student name (fixed format: First_name<space>Last_name) and numerical grade (between 0 and 100) as input and you will construct student objects. For name and numerical grade, the student class will provide get and set methods. String getName() setName(string s) double getNumericalGrade() setNumericalGrade(double n) There will also be the following two methods: char getLetterGrade(): This will use the numerical grade and convert it into a letter grade. The conversion logic will be as follows: (score >= 90 && score <= 100) gets an A (score >= 80 && score < 90) gets a B (score >= 60 && score < 80) gets a C (score >= 50 && score <60)gets a D (score<50) gets an F String getDisplayText(): This method will process student name and use the letter grade to construct the following text: LastName, FirstName received the grade grade [Eg., Doe, John received the grade A] After constructing the student object you will store them in an array and sort them in descending order of their numerical grade. After sorting, you will iteratively go through that array and print the output of getDisplayText() for each objects.
Sample input: 3 Joe Black 81.5 David Fisher 91 Matthew Perry 83 Sample output: Fisher, David received the grade A Perry, Matthew received the grade B Black, Joe received the grade B