Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can somone help me make a program that generates a list of random integers and outputs them to a file named randomNumbers.txt.Then the program opens

Can somone help me make a program that generates a list of random integers and outputs them to a file named "randomNumbers.txt".Then the program opens the le "randomNumbers.txt" as the input file, reads all the numbers from the file, and outputs the largest/smallest numbers and the average of all the numbers to the screen.

The "randomNumbers.txt" file contains nothing but numbers of type int separated by blanks and/or line breaks. You can choose the size of the list and the range of the random numbers. You will need to create one or more test files in order to test your program

The program should display the largest and smallest numbers, and the average of all the numbers to the screen.

Hints: the program should calculate the followings:

  • The number of numbers in the le
  • The largest and smallest numbers
  • The sum of all the numbers in the le (a running total)

The average of all the numbers in the le

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

Step: 3

blur-text-image

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions