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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started