CSc 220 Assignment 1

Are We There Yet?

Assigned
Due

Aug 20
20 pts
Aug 26

This is a simple project for practice running and submitting a program.

Write a C++ program which requests a speed in miles per hour, represented as a floating point number, and a distance in miles, also floating point. It should then print out the time, in hours, required to travel that distance at that speed.

[bennet@desktop asst1]$ ./runtime Enter speed of travel (mi/hr): 68 Enter distance (mi): 135 Vehicle will require 1.98529 hours to travel 135 miles at 68 mi/hr [bennet@desktop asst1]$ ./runtime Enter speed of travel (mi/hr): 41.8 Enter distance (mi): 58.9 Vehicle will require 1.40909 hours to travel 58.9 miles at 41.8 mi/hr [bennet@desktop asst1]$ ./runtime Enter speed of travel (mi/hr): 100 Enter distance (mi): 200 Vehicle will require 2 hours to travel 200 miles at 100 mi/hr

Use the standard I/O facility to prompt for and read each value. Put your program in a file with an extension .cpp. Compile it and test it, then fix any errors.

Program code should always be properly commented, and this short program is not an exception, though not a great deal would be required. A short description of what the program does is sufficient; more is fine.

When your program works and looks nice, submit over the web here.