The c++ program class called Time will have 3 integer data members named hrs, mi
ID: 3638438 • Letter: T
Question
The c++ program class called Time will have 3 integer data members named hrs, mins & secs which would be used to store hours, minutes and seconds. Member function will contain a constructor that supply’s default values “zero” for each data member, a display function that prints an object’s data values and lastly, an assignment operator that execute a member intelligent assignment between “2 Time objects”.Im getting errors=feedback using visual studio 201 c++ programming, am I missing something when i compilethe data??#include <iostream>
using namespace std;
int main()
{
class Time
{
int hrs,mins,secs;
public:
Time(int Hrs=0,int Mins=0,int Secs=0;)
{
hrs=Hrs;
mins=Mins;
secs=Secs;
}
void display()
{
cout<<"hrs = "<<hrs<<endl;
cout<<"mins= "<<mins<<endl;
cout<<"secs= "<<secs<<endl;
}