Answered step by step
Verified Expert Solution
Question
1 Approved Answer
pls solve QUESTION 2 Ministry of Higher Education, Malaysia is required to prepare a report of the number of students' intake, enrolment, and output in
pls solve
QUESTION 2 Ministry of Higher Education, Malaysia is required to prepare a report of the number of students' intake, enrolment, and output in public universities (2015). Write a complete C++ program to calculate the total and average number of students' intake, enrolment, and output in public universities for 2015. Then, find the highest and lowest number of students' intake, enrolment, and output. Finally, find the range of the number of students' intake, enrolment, and output. Write the program according to the following task: Task 1: Write the definition of function getInput. The function must read inputs from an input file named "input.txt" consisting of the list of public universities in Malaysia along with its number of students' intake, enrolment, and output. The read data are then stored in arrays accordingly. Figure 4 shows the input file of the program. Input Validation: You should ensure that the program will only continue reading the input file if it is successfully opened, otherwise print the error message and terminate the program. Task 2: Write the definition of function calTotal. This function calculates the sum of elements of an array. Task 3: Write the definition of function getLowest. The function finds the index with the lowest value in the array. Task 4: Write the definition of function getHighest. The function finds the index with the highest value in the array. Task 5: Using appropriate functions, read inputs from the input file and print it into the output file named "output. txt". Note: Use proper output formatting. Task 6: Using appropriate functions, calculate the total and average of students' intake, enrolment, and output. Then, print it into the output file. Note: Use proper output formatting. Task 7: Using appropriate functions, find the highest and lowest number of students' intake, enrolment, and output. Then, print it along with the name of the university into the output file. Finally, find the range of the number of students' intake, enrolment, and output. Then, print it into the output file. Task 8: You should ensure the program is able to run and display the correct output in the output file. NUMBER OF STUDENTS' INTAKE, ENROLMENT AND OUTPUT IN PUBLIC UNIVERSITIES (2015)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