Integer distanceWalked and double distance Traveled are read from input. Output the following: • distanceWalked with a +/-sign, O's as padding, and a minimum of 6 characters. distance Traveled left-aligned, a minimum of 6 characters, and 2 digits following the decimal point. End each output with a newline. Ex: If the input is 45 3.75, then the output is: +00045 3.75

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 30PE
icon
Related questions
Question
Integer distanceWalked and double distance Traveled are read from input. Output the following:
• distanceWalked with a +/-sign, O's as padding, and a minimum of 6 characters.
distance Traveled left-aligned, a minimum of 6 characters, and 2 digits following the decimal point.
End each output with a newline.
Ex: If the input is 45 3.75, then the output is:
+00045
3.75
Transcribed Image Text:Integer distanceWalked and double distance Traveled are read from input. Output the following: • distanceWalked with a +/-sign, O's as padding, and a minimum of 6 characters. distance Traveled left-aligned, a minimum of 6 characters, and 2 digits following the decimal point. End each output with a newline. Ex: If the input is 45 3.75, then the output is: +00045 3.75
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning