Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed 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 integers in each of the following ranges: 0 - 24, 25 49, 50 74, 75 99, 100 124, 125 149, 150 174 , and 175 200 .Outputtheranges

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.

1. Write a program that reads from the file HW4 Q1data.txt 30 integers in the range 0 200. The program then determines the number of integers in each of the following ranges: 0 24, 25 49, 50 74, 75 99 1000 124, 125 149 150 174, and 175 200. output the ranges 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, 8 7, 9 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. Create the main to test your code. Sample output: TEACHINGW116 C. Programming HMVHWA Q1 exe" Range of Students 25 49 74 15 124 25 149 50 174 75 Process returned e (exe) execution tine 0.016 s Press any key to continue

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

More Books

Students also viewed these Databases questions

Question

What could be expected as a project outcome?

Answered: 1 week ago