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
Levart [38]
2 years ago
8

A teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to

a student, based on the average of his or her four test scores: 90-100 A 80-89 B 70-79 C 60-69 D 0-59 F Write a program that uses an array of string objects to hold the five student names, an array of five characters to hold the five students' letter grades, and five arrays of four doubles to hold each student's set of test scores. The program should allow the user to enter each student's name and his or her four test scores. It should then calculate and display each student's average test score, and a letter grade based on the average. Input Validation: Do not accept test scores less than 0 or great than 100.
Computers and Technology
1 answer:
AlladinOne [14]2 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main()

{

const int numofStudents = 5;//number of students

const int numofTests = 2;//number of tests taken by students

const int grade = 5;//number of grades available

char letter[grade] = { 'A','B','C','D','F' };

double table[numofStudents][numofTests];//defining 2darray with names and scores

string names[numofStudents];//storing names of students

for (int num = 0; num < numofStudents; num++)//storing names and scores of students

{

 cout << "Enter student's name: ";

 cin >> names[num];

 for (int test = 0; test < numofTests; test++)//scores loop

 {

  cout << "Enter the test score: ";

  cin >> table[num][test];

  if (table[num][test] < 0 || table[num][test]>100)//input validation

  {

   cout << "Invalid input. Try again" << endl;

   cin >> table[num][test];//input again

  }

 }

}

for (int i = 0;i < numofStudents;i++)//calculating averages and grades

{

 int sum = 0;

 cout << "Test scores for " << names[i] << ": " << endl;

 for (int j = 0;j < numofTests;j++)

 {

  cout << table[i][j] << " ";

  sum += table[i][j];//summing scores

 }

 cout << endl;

 float average = (float)sum / numofTests;//calculating the average

 cout << "Making an average of: "<< average;

 if (average <= 100 && average >= 90)//assigning a grade

 {

  cout << " and has received an " << letter[0];

 }

 else if (average <= 89 && average >= 80)

 {

  cout << " and has received a " << letter[1];

 }

 else if (average <= 79 && average >= 70)

 {

  cout << " and has received a " << letter[2];

 }

 else if (average <= 69 && average >= 60)

 {

  cout << " and has received a " << letter[3];

 }

 else if (average <= 59 && average >= 0)

 {

  cout << " and has received an " << letter[4];

 }

 else

 {

  cout << "Invalid scores entered." << endl;

 }

 cout << endl;

}

 return 0;

}

Explanation:

We first define the number of students, number of tests and number of grades available for assignments. We then fill in the 2D array of students names and their scores making sure assigning more than 100 and less than 0 is not allowed. We then sum the scores and retrieve an average. Using the average, a letter grade is assigned to that individual.

You might be interested in
Michael Holliday is a business systems analyst who is working on a feasibility study for a new​ e-911 system for the city of Mem
postnew [5]

Answer:

E

Explanation:

The requirement analysis phase is a very key vital phase of the system life cycle in which a system designer sees the future result of his input in the system he intends to design, the requirement analysis clearly state the result of any system in progress design and proccess stage

7 0
3 years ago
Alexa hoped that a good outline will accomplish which of the following for her<br> presentation?
atroni [7]

Answer: A. Help her distinguish between main topics and subtopics.

Explanation: APEX

6 0
3 years ago
Read 2 more answers
Which statement describes part of the meeting scheduling process? It is always an all-day event. It is created in a single calen
olga nikolaevna [1]

Answer:

is there a pic or something, sorry i cant help at the time being

Explanation:

5 0
2 years ago
It is used between two or more computers. One computer sends data to or receives data from another computer directly.
dmitriy555 [2]

Answer:

File transfer protocol (FTP)

Explanation:

An information can be defined as an organized data which typically sent from a sender to a receiver. When a data is decoded or processed by its recipient it is known as information.

Generally, there are several channels or medium through which an information can be transmitted from the sender to a receiver and vice-versa. One of the widely used media is the internet, a global system of interconnected computer networks.

There's a standard framework for the transmission of informations on the internet, it is known as the internet protocol suite or Transmission Control Protocol and Internet Protocol (TCP/IP) model. One of the very basic rule of the TCP/IP protocol for the transmission of information is that, informations are subdivided or broken down at the transport later, into small chunks called packets rather than as a whole.

The three (3) main types of TCP/IP protocol are;

I. HTTP.

II. HTTPS.

III. FTP.

File transfer protocol (FTP) is used between two or more computers. One computer sends data to or receives data from another computer directly through the use of network port 20 and 21.

4 0
2 years ago
Who else hates it when Edgenuity has technical problems with international students?
konstantin123 [22]

Answer: ya it sucks

AI used to be a A student until edgenuity had to be used.

Explanation:

7 0
3 years ago
Other questions:
  • By issuing concert tickets on the blockchain, fans can verify transfer of ownership from one digital wallet to another, rather t
    14·1 answer
  • In this digital age of rapid communications, how can you justify the time it takes to stop and revise a message
    10·1 answer
  • What is looping in QBASIC​
    9·1 answer
  • Mihaela I. Croitoru – Utilizarea calculatorului personal Microsoft Word dau coroana
    14·1 answer
  • Voice authentication requires speech to text capability Facial recognition may be used for authentication The human iris is uniq
    6·1 answer
  • You are in the windows power shell window and decide to encrypt folder which of the following command do you use
    7·1 answer
  • What is the missing line of code?
    10·2 answers
  • How many constructors are there in the following class declaration?class CashRegister { public: CashRegister(); CashRegister(int
    8·1 answer
  • Identify 5 products/services needed by the people in our current situation.<br>​
    6·1 answer
  • Tres areas donde se aplica la ciencia y tecnologia
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!