Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions