1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leno4ka [110]
3 years ago
5

Write a program that will ask the user to input 5 test grades. Store the test grades in an array. Last output the tests from the

array onto the display screen.
Sample Run: Your program must run exactly like the example below.

Enter grade 1: 100

Enter grade 2: 90

Enter grade 3: 89

Enter grade 4: 77

Enter grade 5: 100

Grade #1: 100

Grade #2: 90

Grade #3: 89

Grade #4: 77

Grade #5: 100

Press any key to continue
Computers and Technology
1 answer:
uranmaximum [27]3 years ago
5 0

Answer:

Following are the program of C++

#include <iostream> // header file

#include <iomanip> // header file  

using namespace std; // namespace

int main() // main function

{

int grade[5],k; // declaration of array  and variable

for (int i = 0;  i< 5; i++) // iterating over the loop

{

cout << "Enter grade ";

cin >> grade[i]; // read the grade by the user

}

k=0;

while(k<5) // iterating over the loop

{

cout << "Grade #" << k + 1 << ": ";

cout << grade[k] << endl; // display the grade  

k++; // increment of i

}

}

Output:

Enter grade 45

Enter grade 5

Enter grade 8

Enter grade 6

Enter grade 7

Grade #1: 45

Grade #2: 5

Grade #3: 8

Grade #4: 6

Grade #5: 7

Explanation:

The description of the program is given below.

  • Declared an array "grade" of int type  
  • Read the grade elements by the user using the for loop
  • finally, display the grade in the given format which is mention in the question.
You might be interested in
What is the most important job of a web server?
attashe74 [19]

Answer:

Provide requested web pages to clients; the other tasks listed there are secondary to that.

6 0
3 years ago
Read 2 more answers
Who wrote Hamlet? <br><br>Brainliest for the right answer​
Alenkinab [10]

Answer:

William Shakespeare wrote hamlet

Explanation:

7 0
3 years ago
Read 2 more answers
Sort Sorts by value; assign new numbers as the keys.
JulijaS [17]

Answer: (a) sort()

Explanation:

Using sort() the keys are not preserved. However it sorts the array.

example : sort($array);

6 0
4 years ago
A list that is not sorted by numbers is called a?
Feliz [49]

Answer:

An unordered list(HTML)

6 0
3 years ago
Care sunt avantajele fișierelor de tip ".pdf" ?
Alex787 [66]

Answer:

english i speak .

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • A switch operates in the OSI reference model __________ layer and uses the __________ address to forward packets.
    8·1 answer
  • The students of a college have to create their assignment reports using a word processing program. Some of the questions in thei
    5·2 answers
  • What's the best way to change the font size of all your notes pages at once?
    14·2 answers
  • A small cluster of three countries (China, Malaysia, and Korea) are creating a reputation for this type of outsourcing. a. Farsh
    6·1 answer
  • In which situations would it be most helpful to filter a form? Check all that apply.
    8·1 answer
  • To all paladins players out there!!!!!
    14·1 answer
  • List how much hard disk capacity you recommend, and write a sentence explaining why.
    8·1 answer
  • One standard photo editing software programs for professionals is which of the following?
    11·2 answers
  • How can you prevent someone with access to a mobile phone from circumventing access controls for the entire device
    5·1 answer
  • Denelle, an accountant, needs to present her client Stephen with a page showing how his yearly retirement savings will be affect
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!