Isaac H.

asked • 12/21/22

Write an interactive program that repeatedly asks the user to input a number until "Enter" is hit.

Write an interactive program that repeatedly asks the user to input a number until "Enter" is hit. Your program should create a file named "numbers.txt" where all the numbers are written one below the other, and the last line should display the sum of all the input, after the string "The sum of your numbers is".

For example, if the user inputs 3, 5, 7, 10, -3, 5.2, then the file "numbers.txt" should contain:

3

5

7

10

-3

5.2

The sum of your numbers is 27.2

1 Expert Answer

By:

Michael S. answered • 12/22/22

Tutor
5 (58)

Software Engineer

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.