Question: Help me with C + + code: Complete the code to output 6 0 seconds = 1 minute. On the next line, output the

Help me with C++ code:
Complete the code to output "60 seconds =1 minute". On the next line, output the value of lengthSecs to two digits after the decimal point, followed by " seconds =", and then the value of lengthMins to four digits after the decimal point, and lastly " minutes". End with a newline.
Ex: If the input is 120.00, then the output is:
60 seconds =1 minute
120.00 seconds =2.0000 minutes
Note: setprecision(X) can be used in an output statement to print a double to X digits after the decimal point.he right C++ code:
#include
#include
using namespace std;
int main(){
double lengthSecs;
double lengthMins;
cin >> lengthSecs;
lengthMins = lengthSecs /60;
cout <<"60 seconds =1 minute" << endl;
std::cout << std::setprecision(5)<< lengthMins;
cout << lengthSecs <<" seconds ="<< lengthMins <<" minutes";
cout <<"
";
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!