
Concept explainers
IF NOT COMFORTABLE WITH CLASSES,
I WOULD START WITH DEFINING THE CLASS WITH ONE constructor AND GO FROM THERE
Use the following to calculate a GPA (the following is for calculation information only):
A = 4.00 grade points per credit hour
A- = 3.70 grade points per credit hour
B+ = 3.33 grade points per credit hour
B = 3.00 grade points per credit hour
B- = 2.70 grade points per credit hour
C+ = 2.30 grade points per credit hour
C = 2.00 grade points per credit hour
C- = 1.70 grade points per credit hour
D+ = 1.30 grade points per credit hour
D = 1.00 grade points per credit hour
D- = 0.70 grade points per credit hour
gpa calculation = total grade points received (see above)/ number hours attempted
If you took 3 classes; 3 credit hours each; received an 'A' in each class
A = 4.00 points per credit hour means a total of 36 grade points earned
for 9 attempted hours
gpa = 36/9 = 4.0
1. Create a header file (*.h) for a class named Student defined as follows:
Private variables to hold:
first name
last name
street address
city
state
zip
earned grade points
attempted credit hours
gpa
Public methods:
constructor of type Student; set all the private variables to space
or zero, depending on the data type
constructor of type Student; set all name values and all address values
to values passed in as parameters, do not include earned grade point or
attempted credit hours as parameters
constructor of type Student; set ALL private variables to values
passed in as parameters
method to display all private variables of the class (i.e., cout)
method to calculate the gpa (no parameters)
method to calculate the gpa with earned and attempted values passed in as parameters
method to set the earned value; earned value passed in as parameter
method to set the attempted value; attempted value passed in as parameter
2. Create an implementation program (*.cpp file) for class Student and code all the public methods.
3. Create a client program (*.cpp) that uses class Student. Create three students using each of
the three constructors defined in 1. Be aware of what data gets initialized or set to values.
4. Calculate the gpa for each of the students.
5. Display ALL the data for each of the students after the gpa has been calculated (name, full address,
grade points earned, grade points attempted, gpa)
6. Be aware that if the first two constructors are used, the earned and attempted
values will NOT be set to calculate the gpa. Try using your set methods
to give these a value.
You will need to create a project.
If you like to include the following line of code: system("pause");
You MAY need to: #include <cstdlib>
Complete as much as you can before you submit ensuring what you've completed compiles. You do not have to correctly
solve the coding exercise, however, you MUST include code that ATTEMPTS to solve the problem to get credit.
The program may be named any name of your choice and must have a .cpp extention. Do NOT include
spaces in program names; variables may be any name of your choice.

Trending nowThis is a popular solution!
Step by stepSolved in 6 steps with 6 images

- I need help with a C++ project. I need to finish the program. The program is supposed to shuffle and deal a deck of cards. Here is what I am given: This is Card.h: #ifndef CARD_H#define CARD_H#include <string>class Card {public:static const size_t FACES{13}; // total number of facesstatic const size_t SUITS{4}; // total number of suitsenum class Face {Ace, Deuce, Three, Four, Five, Six, Seven, Eight,Nine, Ten, Jack, Queen, King};enum class Suit {Hearts, Diamonds, Clubs, Spades};Card(Face cardFace, Suit cardSuit); // initialize face and suitstd::string toString() const; // returns a string representation of a Card// get the card's faceFace getFace() const {return face;}// get the card's suitSuit getSuit() const {return suit;}private:Face face;Suit suit;static const std::string faceNames[FACES];static const std::string suitNames[SUITS];};#endif This is DeckOfCards.h: #ifndef DECK_OF_CARDS_H#define DECK_OF_CARDS_H#include <vector>#include "Card.h"// DeckOfCards class…arrow_forwardCan you help me with this code for C++ please: Modify the class Song you created for part 2 bydoing the following:(a) Add a default constructor that initializes the song to have invalid astitle and artist, and −1 as recording year.(b) Add a constructor Song(title) that initializes the song to thegiven title (that is, to the title given as argument). The artist andrecording year are initialized to unknown and −1, respectively. Theargument is a string.(c) Add a constructor Song(title, artist, year) that initializesthe song to the given title, artist and recording year. The first twoarguments are strings, the third one is an integer.(d) Replace the function equals(s1, s2) by a methodequals(other) that returns true if the receiver and theargument have the same title, artist and recording year.(e) Add a method less_than(other) that returns true if the title ofthe first song is less than the title of the second song. In case the titlesof the two songs are identical, the method returns true…arrow_forwardthis is ony one quiestion so please answer them all. USE C++arrow_forward
- define a class with two data members of integer type name as a country, to store the name of the country and population to store the population in millions. the program contains the following member function constructor function to input the name and population of a country. the calculate function to find out the country with the most population the display function to display the name of the country with the most population note: input the record of three countries to run the program language c++arrow_forwardThis is for C++ only, and I will be using visual studio as a compiler. You can use dummy variables that I will change later Write a class named Student that has member variables for the following data: First name, middle name, last name Address, city, state, and ZIP code Email address Student ID# Major The Student class should have a constructor that accepts an argument for each member variable and include accessors and mutators for each member variable. Next, write a class named Course that represents a course the student will take. The Course class should have member variables for the following data: Course ID number Name of the course Name of the instructor Grade earned Number of units The Course class should have a constructor that accepts an argument for each member variable. The Course class should also have accessor and mutator functions for each member variable. write a program that creates an instance of the Student class, initialized with sample data.…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





