URGENT DO WHILE LOOP

closed account (z6f9LyTq)
Write a C++ program that will calculate the average of each student, as well as the class average.

In a Loop, either a While, or Do/While you will input three test scores for each student. Output the student’s average, and then start with the next student.

I need help with this??

Create the code that produces the following output.

Input Section:

ENTER STUDENT #1’s - TEST SCORE NUMBER 1: ? 100

ENTER STUDENT #1’s - TEST SCORE NUMBER 2: ? 90

ENTER STUDENT #1’s - TEST SCORE NUMBER 3: ? 81

Output Section:
Test#1 Test#2 Test #3 Average

Student #1 100 90 81 90.33
closed account (j3Rz8vqX)
Provide what you have so far, then we may be able to help you.

Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
using namespace std;

int main()
{
    //Initialize integers for: Player 1, Player 2, and Player 3.
    //They'd probably want three integer variables to hold their scores or an array of 3 each.

    //You'd probably want to initialize two counters; set to zero.
    //To control the outer loop and inner loop.

    do
    {
        do
        {
            //Ask the user for her score:
            //Record the score.
            
            //Use a counter to break this loop; possibly increment counter here.
        }while(/*Argument equals true*/);//possibly 3 prompts for each student
        //You should print out her scores and average. 
        //Average equals Total divided by the number of prompts
        
        //Use the other counter to break this loop; dependent on number of students.
    }while(/*Argument equals true*/);//Cycle dependent on how many students there are.
    return 0;
}
Topic archived. No new replies allowed.