Question

Design the logic for a program that has two parts. The user enters 15 test scores...

Design the logic for a program that has two parts.

  1. The user enters 15 test scores (values between 1-100) that are stored in an array.
  2. The program uses the array to compute and output the following statistics
    • minimum
    • maximum
    • the average must be an accumulator

Consider using a loop.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: here is the answer for your question:

CODE IN C++:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------


#include <stdio.h>

#include<iostream>
using namespace std;

int main()
{
int arr[15];
  
cout<<"Enter the test scores:\n";
for(int i=0;i<15;i++)
{
cin>>arr[i];
}
  
cout<<"calculating the minimum:\n";
int min=arr[0];
for(int i=1;i<15;i++)
{
if(arr[i]<min)
min=arr[i];
  
}
cout<<"the minimum value in test score is: "<<min<<"\n";
  
cout<<"calculating the maximum:\n";
int max=arr[0];
for(int i=1;i<15;i++)
{
if(arr[i]>max)
max=arr[i];
  
}
cout<<"the maximumm value in test score is: "<<max<<"\n";

cout<<"calculating the average of the test score:\n";
int sum=0;

for(int i=0;i<15;i++)
{
sum=sum+arr[i];
  
}
sum=sum/15;
cout<<"the average of test score is: "<<sum<<"\n";



return 0;
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

CODE SNIPPET:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

OUTPUT:

I hope this would help you out

If you have any doubt, you can provide comment /feedback below the answer

Thanks

Add a comment
Know the answer?
Add Answer to:
Design the logic for a program that has two parts. The user enters 15 test scores...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Design the logic for a program that allows a user to enter 10 numbers, then displays...

    Design the logic for a program that allows a user to enter 10 numbers, then displays all of the numbers, the sum and average of the numbers. (Use array and loop.) the pseudocode in python please

  • Design the logic for a program that allows the user to enter a maximum of 10...

    Design the logic for a program that allows the user to enter a maximum of 10 numbers. If the use enters a -1 the input loop stops early. The value -1 is not data but a quit flag value that is not entered into the array. Then the program displays the count of the numbers entered and numeric average of the numbers (not including the -1 of course). After display the average of all the entered numbers, the program will...

  • Write a program that allows the user to enter a series of exam scores. The number...

    Write a program that allows the user to enter a series of exam scores. The number of scores the user can enter is not fixed; they can enter any number of scores they want. The exam scores can be either integers or floats. Then, once the user has entered all the scores they want, your program will calculate and print the average of those scores. After printing the average, the program should terminate. You need to use a while loop...

  • Create a C++ program to calculate grades as well as descriptive statistics for a set of...

    Create a C++ program to calculate grades as well as descriptive statistics for a set of test scores. The test scores can be entered via a user prompt or through an external file. For each student, you need to provide a student name (string) and a test score (float). The program will do the followings: Assign a grade (A, B, C, D, or F) based on a student’s test score. Display the grade roster as shown below: Name      Test Score    ...

  • All scores entered into the program must be validated. In order to do this, the program...

    All scores entered into the program must be validated. In order to do this, the program needs to know the range of point available, from zero to the maximum possible score (MaxScore). To do this, implement the form's load-event handler. It should use an input box to get the MaxScore (i.e. total points available) value from the user. This MaxScore value must be validated, using a separate function, as an integer that is greater than zero before being accepted. The...

  • Write a program named ClassifyScores that classifies a series of scores entered by the user into...

    Write a program named ClassifyScores that classifies a series of scores entered by the user into ranges (0-9, 10-19, and so forth). The scores will be numbers between 0 and 100. Design and implement a program to prompt the user to enter each score separately. If the score is within the correct range, then increment the appropriate range If the score entered is greater than 100, display an error message, ignore the incorrect score, and prompt for the user to...

  • Write a complete C++ program that reads students names and their test scores from an input...

    Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...

  • Write a C program Design a program that uses an array to store 10 randomly generated...

    Write a C program Design a program that uses an array to store 10 randomly generated integer numbers in the range from 1 to 50. The program should first generate random numbers and save these numbers into the array. It will then provide the following menu options to the user: Display 10 random numbers stored in the array Compute and display the largest number in the array Compute and display the average value of all numbers Exit The options 2...

  • Using the nested loop in C++ to finish the program //test scores. //It asks the user...

    Using the nested loop in C++ to finish the program //test scores. //It asks the user for the // number of students and //the number of test scores //per student. // Calc. and display average score // for each TEST 2 4 6 7

  • convert pseducode to c++ Starting out with Programming Logic and Design (3) - Read-only Terates once...

    convert pseducode to c++ Starting out with Programming Logic and Design (3) - Read-only Terates once for each student. The nested inner loop, in lines 27 through 31, iterates once for each test score. Program 5-20 1 1 This program averages test scores. It asks the user for th 2 1/ number of students and the number of test scores per stude Declare Integer numStudents 4 Declare Integer numTest Scores 5 Declare Integer total 6 Declare Integer student 7 Declare...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT