Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Cpp :: nodeafternode 
Cpp :: vector stop at newline 
Cpp :: Arduino C++ servomotor random moving 
Cpp :: how to merge string array in C++ 
Cpp :: initialize many variablles c++ 
Cpp :: how to insert variable into string c++ 
Cpp :: Pawri Meme codechef solution in c++ 
Cpp :: ros pointcloud2 read_points c++ 
Cpp :: can you use rand to read in from an external file inc++ 
Cpp :: convert GLFWwindow* to IntPtr 
Cpp :: interactive problem 
Cpp :: c++ how to iterate through 2d array in c++ 
Cpp :: c++ void to avoid functions 
Cpp :: c++ code 
Cpp :: time optimisation c++ 
Cpp :: syntax of member function in c++ 
Cpp :: graph colouring backtracking 
Cpp :: add nested vector cpp 
Cpp :: csv 
Cpp :: c++ negate boolean 
Cpp :: how to srt vector array 
Cpp :: 771. Jewels and Stones leetcode solution in c++ 
Cpp :: cuda atomic swap 
Cpp :: How to get the last element of an array in C++ using std::array 
Cpp :: short hand if else in c++ 
Cpp :: void pointer c++ 
Cpp :: call by value in c++ 
Cpp :: why ostream cannot be constant 
C :: how to set a pointer to an offset in c 
C :: roll binary c 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =