Answered You can hire a professional tutor to get the answer.

QUESTION

46 //loop through quarters and write to file 47 for (int j = 0; j lt; 4; j++) Enter quarter 1Scores : 48 asdf: 15 cout lt;lt; \nEnter...

I need help in c++. I have a problem where I need to write two separate lines to a .txt file. My challenge is thus. I am taking data for team a and team b 4x, but need to write team a in one row and team b in the second. Is there a way to accomplish this without splitting it out by teams instead of quarters?

How it's need to display in the txt:

15 16 17 18

15 16 17 18

46//loop through quarters and write to file47for (int j = 0; j < 4; j++)Enter quarter 1Scores :48asdf: 15cout << "\nEnter quarter-" < < +(j + 1) << "Scores :asdf: 15cout << "\n" << teamA <<cin > > score;Enter quarter 2Scores :teamARec << score <<asdf: 16cout << teamB <<asdf: 16cin > > score;teamARec << score << " ";/ /changed here for testingEnter quarter 3Scores :asdf: 17asdf: 17/ /open teamnames . txt file and read team namesEnter quarter 4Scores:ifstream readTeams;asdf: 18readTeams . open ("teamnames . txt" ) ;asdf: 18if (readTeams . fail( ))63teamarec - NotepadXProject . exe (proce64cout << "**teamnames . txt File Not Found**"65return 1;<< en File Edit Format View Helpbugging->Automatica661515 16100 %16 17Output17 18Show output from: Debug18'Nixon_Ashley_FinalProject . exe' (Win32) : Loaded 'C: \Windows\SysWOW6.Nixon_Ashley_FinalProject . exe' (Win32) : Loaded 'C: \Windows\SysWOW6-array to readThe thread 0x4890 has exited with code 0 (0x0).The thread 0x5970 has exited with code 0 (0x0).The thread Oxbdc has exited with code 0 (0x0) .The program ' [11660] Nixon_Ashley_FinalProject . exe' has exited withth,request overError List OutputLn 52Col 33Ch 27INSt Add to Source Control
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question