Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE SOLVE USING OBJECT ORIANTED APPROCH IN C++ ONLY Define a student class. A student has the following attributes: firstname, lastname, gender which can be
PLEASE SOLVE USING OBJECT ORIANTED APPROCH IN C++ ONLY
Define a student class. A student has the following attributes: firstname, lastname, gender which can be male or female, status which can be equal to freshman, sophomore, junior, and senior and ep. Then define the following methods for the student class. The show_nyself method will simply print all the attribute variables when called upon the object. This method has no input arguments. The study_time method will increment the gps of the student according to the following formula: Epa = 2pz + 2og(study_tine)'. The only input argument of this method is the variable study_time. In addition make sure that the epa variable never exceeds 4.0 even if the student studies for a very long time. Now define 5 student objects and store the objects in a list called student_list. The five students are: Mike Barnes, Jim Nackerson , Jack Indabox , Jane Mller and Mary Scott. Mike is a freshman, Jim a sophomore, Jack a junior, Jane and Mary are seniors. Their respective GPAs are: 4.3, 2.5, 3.6 and 2.7. Make sure you assign the gender when you instantiate the objects Then call the show_myself method on all of them. I suggest you use a loop for making the objects and a separate loop for showing the objects. Use your objects from above and let each one of the 5 students study for 68, 169, 40, 300, 1808 minutes, respectively. So the first student studies 60 minutes, the second studies 100 minutes, etc. After that call the show_myself methods on all 5 again and check whether their new gpa reflects how much they studiedStep 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