Question
c++ language Write a program that asks the user for a file name, ask the user for up to 30 input value Write the user
c++ language
Write a program that
asks the user for a file name,
ask the user for up to 30 input value
Write the user input values to the file.
Set only the current values in the array to zero
Re-read the contents of the file back into the array
Using the array, display the following data:
lowest number
highest number
total of the numbers
average of the numbers
Write the array back to a NEW file, in reverse order. Call this file reverse.txt.
Provide a "sentinel value" to allow the user to stop entering numbers. (if i only want 5 numbers, i should only have to enter 5 numbers, but if i want to enter 30, then i should be able to enter 30.)
Once you have the program working, create functions that calculate each of the items above. Your function should take an array and the size of the array as input, and return the value calculated. So you should have a function that finds the minimum, a different function that finds the maximum, another function that gets the total, and one that counts the number of numbers in the array divisible by a number the user chooses. Your program should print all the information - your functions should not.
this assignment covers:
loops
files
arrays
functions with input parameters
functions with return values
arithmetic functions
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