Question: Modify the printMeFirst() function below to include your personal information, and call the function 1st before anything else. Below is the sample of the program
Modify the printMeFirst() function below to include your personal information, and call the function 1st before anything else. Below is the sample of the program template
#include #include #include #include
using namespace std;
You can use the following template for all your function documentation format
/**Print out the programmers information such as name, class information and date/time the program is run
@param name - the name of the programmer
@param courseInfo - the name of the course
*/ @return - none
void printMeFirst(string name, string courseInfo)
{
cout <<" Program written by: "<< name << endl; // put your name here cout <<" Course info: "<< courseInfo << endl;
time_t now = time(0); // current date/time based on current system char* dt = ctime(&now); // convert now to string for
cout << " Date: " << dt << endl;
}
I don't know how to include my personal information with my work below ?
#include
#include
#include
#include
#include
using namespace std;
float Farenheit(float);
float Celsius(float);
int main()
{
float temp1, temp2;
int ch;
do
{
cout<<" Menu";
cout<<" 1. Conversion from Seconds to Hours, Minutes,Seconds";
cout<<" 2. Conversion from Farenheit to Celsius";
cout<<" 3. Conversion from Celsius to Farenheit";
cout<<" Enter User Choice:";
cin>>ch;
switch(ch)
{
case 1:
int tot_sec, min, hr, minutes, seconds;
cout<<" Conversion from Seconds to Hours, Minutes, Seconds";
cout<<" Enter number of Seconds:";
cin>>tot_sec;
if(tot_sec<0)
cout<<" Enter Positive Integer only";
else if(tot_sec==0)
cout<<" Enter Other then 0";
else if(tot_sec>0)
{
hr=tot_sec/3600;
min=tot_sec/60;
minutes=min%60;
seconds=tot_sec%60;
cout<<" Total Seconds"<
}
break;
case 2:
cout<<" Enter Temperature:";
cin>>temp1;
if(cin.fail())
cout<<"\ Enter Correct Input for Farenheit";
if(!cin.fail())
{
Farenheit(temp1);
cout<<" Farenheit"<
}
break;
case 3:
cout<<" Conversion from Celsius to Farenheit";
cout<<" Enter Celsius:";
cin>>temp2;
if(!cin)
{
cout<<" Enter Integer only";
}
else
{
Celsius(temp2);
cout<<" Celsius"<
}
break;
}
}while((ch<=1)&&(ch<4));
return 0;
}
float Farenheit(float temp1)
{
return ((temp1-32)*5)/9;
}
float Celsius(float temp2)
{
return((temp2*9)/5)+32;
}
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
