Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

There is a problem in my textbook that I just can\'t get theright solution for.

ID: 3617118 • Letter: T

Question

There is a problem in my textbook that I just can't get theright solution for. It says: Write a looping code segment that takes as input up to 20integer scores from file indata, and outputs theiraverage. If the file contains fewer than 20 scores, the segmentshould still output the correct average. If the file contains morethan 20 scores, the additional numbers should be ignored. Be sureto consider what happens if the file is empty. There is a problem in my textbook that I just can't get theright solution for. It says: Write a looping code segment that takes as input up to 20integer scores from file indata, and outputs theiraverage. If the file contains fewer than 20 scores, the segmentshould still output the correct average. If the file contains morethan 20 scores, the additional numbers should be ignored. Be sureto consider what happens if the file is empty.

Explanation / Answer

please rate - thanks #include #include using namespace std; int main() {int a,sum=0,i=0; ifstream in; ofstream out; in.open("indata.txt");        if(in.fail())               { cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote