Question: Program 2 ( 9 marks ) Let ( money . txt ) be a text file that contains amounts of money spent on clothes. Assume
Program marks
Let moneytxt be a text file that contains amounts of money spent on clothes. Assume the num
ber of values stored in the file in unknown. Write a complete program that reads the money
amounts from the text file and outputs the following information to the console:
The number of values stored in the file
The number of money amounts that are in the interval
The number of money amounts that are in the interval
The number of money amounts that are in the interval
Example: if the values stored in the file are:
then your program should print out:
The number of values stored in the file is
The number of money amounts that are in the interval is
The number of money amounts that are in the interval is
The number of money amounts that are in the interval is
Note: test if the text file is opened correctly.
Hint: use a while loop.
Question on Program : Mark
Briefly explain what would be changed if we were to output the information to a text file instead
of the console?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
