Question
Write a C++ program that reads from the file HW4_Q1data.txt 30 integers in the range 0 200 . The program then determines the number of
and the number of integers in each range. (Use the following values in the file HW4_Q1data.txt: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189, 137, 23, 192, 78).
Specifically, create the following functions:
-
void readData(char filename[], int list[], int size); This function reads from file filename and populates (or increments) the list array location belonging to each number from the file.
-
void print(int list[], int size); This function will print the ranges and the number of students that have scores in a particular range, as shown below.
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