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
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
Get step-by-step solutions from verified subject matter experts
