Question
For C++ 1. Design and implement a class that will represent a student; call the class Student. Name your instance variables firstName, lastName, GPA (double)
For C++
1. Design and implement a class that will represent a student; call the class Student. Name your instance variables firstName, lastName, GPA (double) and credits (integer). Have a function called addCredits. This function will add some number of credits that is passed to it to the students current credits. Implement Accessors and Mutators for all instance variables of the class. Have two constructors; the first will be the default constructor (set all instance variables to 1) and the second will be a constructor that will pass arguments to set the instance variables of the object. Develop a function calculateLetterGrade which will return the correct letter grade according to the table below: GPA Letter Grade < 1.0 F >=1.0 and < 2.0 D >=2.0 and < 3.0 C >=3.0 and < 3.6 B >=3.6 A Develop a function printStudentInfo which will print all student data in neatly formatted output on the console.
In the main instantiate three Student objects called Dick, Jane and Harry. The values to be passed are in the table below: Object Dick, Jane, Harry Instance Variables firstName Dick, Jane, Harry lastName Smith, Jones, Adams GPA 3.62, 2.98, 1.13, credits 27, 36, 49.
The main is to complete the following additional details: 1. Instantiate the object Dick by using the default constructor; then use your setters to put the data in the above table into the object. 2. Instantiate the object Jane by using the constructor with parameters and passing all data to instantiate the object through that constructor. 3. Instantiate the object Harry by using the constructor with parameters and passing all data to instantiate the object through that constructor. 4. Print the details of all objects using the printStudentInfo method. 5. Assume this semester is now over, and you need to update the student records. And 12 credits to Dick, add 16 credits to Jane and add 15 credits to Harry. 6. Print the details of all objects using the printStudentInfo method.
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