Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

easy way to learn file handling in c++ array

Write a program that will read scores from the file into an array. The size of the array should be input by the user (dynamic array). The program will find and print out the average of the scores. Also find the maximum and minimum score. Then call a function that will sort the scores in ascending order. The values are then printed in this sorted order.
Expected output:
Please input the number of scores: 5
Please enter a score: 100
Please enter a score: 90
Please enter a score: 95
Please enter a score: 100
Please enter a score: 90
The average of the scores is 95. 
Maximum score is 100. 
Minimum score is 90.
Here are the scores in ascending order: 90 90 95 100 100
 
PREVIOUS NEXT
Tagged: #easy #learn #file #handling #array
ADD COMMENT
Topic
Name
3+2 =