Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ No need for question one and two, and can you include screenshots please, thanks 1. Create the following input file: - student_marks.txt - Notepad
c++
No need for question one and two, and can you include screenshots please, thanks
1. Create the following input file: - student_marks.txt - Notepad File Edit Format View Help 66 47 88 75 Write a program that will read exactly 4 lines from this input file (i.e. use a counter to determine when to break out of your loop). 2. Re-write the above program but have it break out of an indefinite while-loop using a break statement. 3. Re-write the above program so that you read until the end of the file (i.e. using the built-in eof() function) 4. Modify the above program so that you print the average of the 4 marks to the console. (Hint: keep a running total of the marks (an accumulator) and when the loop is finished divide by the number of lines. You will also need to convert each number that is read from the file to an integer by using the built-in stoi() function)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