I made a code to convert time into minutes and seconds using constructor. In output I'm getting time in seconds but its not displaying time in minutes and can't figured out my mistake so anyone can help me out...
#include<iostream>
using namespace std;
class Time
{
public:
Time(int);
Time(float);
};
Time::Time(int t)
{
cout << "Time in seconds: " << t*60*60 << "\n";
}
Time::Time(float t)
{
cout << "Time in Minutes: " << int(t*60) << "\n";
}
int main()
{
int hr;
cout << "Enter the time in Hours: ";
cin >> hr;
Time t1(hr);
Time t2(float(hr));
}