Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use C++ In this question, we will calculate the total distance a snail travels over a sequence of days Write a program that asks
please use C++
In this question, we will calculate the total distance a snail travels over a sequence of days Write a program that asks the user to enter the number of inches a snail traveled in each day. The numbers should be entered in separate lines, and end with - 1 (to indicate the end of the sequence). After reading the numbers, your program should print the total distance the snail traveled. This distance should be printed in a (miles, yards, inches) format Note: You may use the following facts: I foot = 12 inches I yard = 3 feet Your program should interact with the user exactly as demonstrated bellow. Execution example: Enter the number of inches the snail traveled in day #1, or type -1 if they reached their destination: 132 Enter the number of inches the snail traveled in day #2, or type -1 if they reached their destination: 440 Enter the number of inches the snail traveled in day #3, or type -1 if they reached their destination: 265 Enter the number of inches the snail traveled in day #4, or type -1 if they reached their destination: 7 Enter the number of inches the snail traveled in day #5, or type -1 if they reached their destination: -1 In 4 days, the snail traveled 23 yards, 1 feet and 4 inchesStep 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