Write a program that takes in number of minutes and expresses that in terms ofHo
ID: 3783764 • Letter: W
Question
Write a program that takes in number of minutes and expresses that in terms ofHours and minutes. For example: lfthe user inputs 90, the output of your code must be 1 hour and 30 minutes. (Use the operator) Part Two Write a program that takes in the user's age in years as input Calculate the users age in days Calculate & Output the users age in minutes and seconds Estimate &output; the approdmate number of times the users hearthas beatin hisher lifetime using an average heart rate of T2 beats per minutes. Estimate &output; the number of times the person has sneezed in hisher lifetime(research on the Internet to obtain a daily estimate) Estimate & Output the number of calories that the person has expended in hisher lietime (research on the Internet to obtain a daily estimate) Both parts will be written in the same program and compiled and output together. Note: There should only be 2inputs You have 1 week to complete this Lab 2.21.1. Lab 1 main cpp 2 using namespace stai 4 int maino) 6 You mnt utilize variables for your immatr unsigned int dnutes,seconds, hours, rins,letti 32 DELL F10 F11 e EndExplanation / Answer
Programme-1
------------------------
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int input = 0;
int hours,mins= 0;
cout << "Enter Number of Minitues" << endl;
cin>>input;
hours = input/60;
mins = input%60;
cout << "Hours :"<<hours<<" Minits :"<<mins << endl;
return 0;
}
Programme -2:-
--------------------------------
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int ageInput = 0;
cout << "Enter Age in Years." << endl;
cin>>ageInput;
//Days = Years x 365
cout << "Age in Days :" << ageInput* 365<<endl;
//Minits = No of Days x 1440 (1440 days in each 24hours)
int ageInMins = (ageInput* 365) *1440;
cout << "Age in Minits :" << ageInMins<<endl;
cout << "Age in Seconds :" << ageInMins*60<<endl;
//Average Heart beat in Minits = 72 beats
cout << "Average Heart beat :" << ageInMins*72<<endl;
//The daily mean number of sneezes in all persons was 1.2
cout << "Mean number of sneezes :" << (ageInput* 365*1.2)<<endl;
//Average calories per day 2,000
cout << "Total Number of Calories spent :" << (ageInput* 365*2000)<<endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.