Question
CSCI 221 Lab 3.1 File Number Stats Write a code that asks the user to enter a filename to open. When the user enters the
CSCI 221 Lab 3.1 File Number Stats Write a code that asks the user to enter a filename to open. When the user enters the filename the program should attempt to open the file and then show the numbers in the file followed by the count of how many numbers there were, the average, highest and lowest of the numbers. Use a sentinel controlled loop. Make it match the format below: which file would you like to open? data1.txt Here are the numbers in the file: 1: 10 2: 20 3: 33 4: 45 5: 15 6: 99 7: 75 8: 333 9: 4 10: 18 11: 91 12: 222 13: 333 There were 13 numbers in the file. The average was: 99.85 The highest was: 333 The lowest was: 4 If the file is not found the program should display the following error and quit which file would you like to open? Silly Error opening file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started