Answered step by step
Verified Expert Solution
Link Copied!

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++image text in transcribed

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 inches

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago