Question: You need to submit the source code along with code output Write a program that can be used to store a set of students data,
You need to submit the source code along with code output
Write a program that can be used to store a set of students data, and find out (a) the name of the students whose gpa is less than 2, (b) students whose gpa is between 2 and 3
You need to use a struct called Student as given below:
struct Student
{
int ID;
string first;
string last;
float gpa;
int semesterHours;
int totalHours;
};
All the data are stored in an input file named student.txt. Your program should read the data in an array called students and then do both the exercises (a) and (b).
Define a class called Time, which has three private data members: hours, mins and secs
It also must use the following public functions:
Default constructor to set the time to 0, 0, 0
Another constructor to get the inputs for hours, mins and secs by using proper parameter, and set to private data members.
A void function SetValuess to change the values of hours, mins and secs to desired values
A void function PrintTime, to print the time as hours:mins:secs.
A void function TimeIncrement that will increase the time by 1 sec. (think about it, how will increase the time by 1 sec, this can effect the mins and hours too).
A void function TimeDecrement that will reduce the time by 1 sec.
Your program must define the class, implement the class functions, and should design a driver function which should create a Time type object and test each of the functions. Make sure to call the PrintTime function after each time you cann the TimeIncrement and TimeDecrement functions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
