Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve using Oop in c++ Note:Solve using oop in c++ Define a student class. A student has the following attributes: firstname, lastname, gender which can

Solve using Oop in c++

image text in transcribed

Note:Solve using oop in c++

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 studied

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago