Exercise 2: Distance Travelled
A factory produces X number of cars every day.
Write a program that asks users how many cars are being produced every day, and how many
days. It should use a loop to display the total number of cars produced each day. For example,
if a user inputs 40 cars and 3 days, it should display a report similar to the one that follows:
Day
Total Cars prodcued
+
Day 1
40
Day 2
80
Day 3
120
Input Validation: Do not accept a negative number for speed and do not accept any value
less than 1 for time travelled.
Submission Task: Distance Travelled- File Output
Modify the program you wrote in Exercise 2 so that it writes the report to a file instead of
the screen. Open the file in Notepad or another text editor to confirm the output.