Respuesta :
Solution:
#include<iostream>
using namespace std;
class timeconvert//class
{
public:
int hms_to_secs(int h,int m,int s)//function of the class
{
return (h*3600+m*60+s);
}
};
int main()
{ timeconvert obj;//creating object of the class
int h,m,s,total;
cout<<"enter hour";
cin>>h;
cout<<"enter minute";
cin>>m;
cout<<"enter second";
cin>>s;
total=obj.hms_to_secs(h,m,s);//function call
cout<<"total second of"<<h<<":"<<m<<":"<<s<<"="<<total;
}
/*
sample output:-
enter hour12
enter minute59
enter second59
total second of12:59:59=46799
*/
In this exercise we have to use the computer language knowledge in C++ to write the code as:
the code is in the attached image.
In a more easy way we have that the code will be:
#include<iostream>
using namespace std;
class timeconvert//class
{
public:
int hms_to_secs(int h,int m,int s)//function of the class
{
return (h*3600+m*60+s);
}
};
int main()
{ timeconvert obj;//creating object of the class
int h,m,s,total;
cout<<"enter hour";
cin>>h;
cout<<"enter minute";
cin>>m;
cout<<"enter second";
cin>>s;
total=obj.hms_to_secs(h,m,s);//function call
cout<<"total second of"<<h<<":"<<m<<":"<<s<<"="<<total;
}
/*
sample output:-
enter hour12
enter minute59
enter second59
total second of12:59:59=46799
*/
See more about C++ code at brainly.com/question/25870717
