Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

these are two different codes but the second portion is part of the first code . so I need two different codes, please and thank

image text in transcribedthese are two different codes but the second portion is part of the first code . so I need two different codes, please and thank you.

Write a C++ program that creates a class Student which has the following private attributes: ID (int), name (string), GPA (float) and phoneNumber (string). The class should contain the following public functions: setID(int id) to set the ID value setName (string name) to set the name value setGPA (float gpa) to set the GPA value setphoneNumber (string number) to set the phoneNumber value int getID() to get the ID value string getName() to get the name value float getGPA () to get the GPA value string getphoneNumber() to get the phoneNumber value void displayStudentInfo() to display the student info as: The student ID is 122232, name is Mark, GPA is 3.90, and phone number is 306338560 using the getter functions (e.g., getID). . . . Then, create an array of 5 students and display their information on the screen. Here are the steps: Create an array that can hold 5 students Create 5 objects from the Student class Use the setter functions (e.g., setID) to set the values of the 5 students objects Write a loop that displays the 5-student information stored in the array using the displayStudentInfo() function, each one per line

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago