Question: c++ Doubles depthMeasured1 and depthMeasured2 are read from input. Perform the following tasks: Output depthMeasured1 with a maximum of seven digits, showing the decimal point

c++

Doubles depthMeasured1 and depthMeasured2 are read from input. Perform the following tasks:

Output depthMeasured1 with a maximum of seven digits, showing the decimal point and any trailing 0s.

Output depthMeasured1, not showing the decimal point and any trailing 0s when the fraction is zero.

Output depthMeasured2 in fixed-point notation with a maximum of four digits in the fraction.

Output depthMeasured2 in scientific notation with a maximum of four digits in the fraction.

End each output with a newline.

Ex: If the input is 52.625 9374318.75, then the output is:

52.62500 52.625 9374318.7500 9.3743e+06 NOTE: cout << showpoint shows the decimal point and any trailing 0s even when the fraction (after the decimal point) is zero. cout << noshowpoint clears the showpoint manipulator.

#include #include using namespace std;

int main() { double depthMeasured1; double depthMeasured2; cin >> depthMeasured1; cin >> depthMeasured2; /* Your code goes here */ 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 Databases Questions!