Question

Design the logic for a program that allows the user to enter 15 test scores (values...

Design the logic for a program that allows the user to enter 15 test scores (values between 1-100), then

  • displays the minimum.
  • displays the maximum
  • calculates and displays the average
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

#include<iostream>

using namespace std;

int main()

{

float Z[15],sum=0.0,average;


cout<<"Enter the elements of the array : ";

cin>>Z[0];

float min = Z[0], max = Z[0];

sum = Z[0];

for(int i = 1; i < 15; i++){

cin>>Z[i];

sum = sum + Z[i];

}

average = sum/15;


for(int i = 1; i < 15; i++){

if(Z[i] < min)

min = Z[i];

if(Z[i] > max)

max = Z[i];

}

cout<<"Elements of the array ";

for(int i = 0; i<15; i++){

cout<<Z[i]<<" ";

}

cout<<" The minimum element in the array is: "<<min<<endl;

cout<<" The largest element in the array is: "<<max<<endl;

cout<<" The average of array is "<<average<<endl;

return 0;

}

Output:

Add a comment
Know the answer?
Add Answer to:
Design the logic for a program that allows the user to enter 15 test scores (values...
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 has two parts. The user enters 15 test scores...

    Design the logic for a program that has two parts. The user enters 15 test scores (values between 1-100) that are stored in an array. The program uses the array to compute and output the following statistics minimum maximum the average must be an accumulator Consider using a loop.

  • 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 a user to enter 10 numbers, then displays...

    Design the logic for a program that allows a user to enter 10 numbers, then displays the element number, value in the element, and its squared. The language is Python

  • 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...

  • a. Design the logic for a program that allows a user to enter 12 numbers, then...

    a. Design the logic for a program that allows a user to enter 12 numbers, then displays them in the reverse order of entry. b. Modify the reverse-display program so that the user can enter any amount of numbers up to 12 until a sentinel value is entered. ( I really could use more of a pseudocode rather than actual code. also an explanation of each step. The answer I got last time was just c++ code that including a...

  • write pseudocode to represent the logic of a program that allows the user to enter a...

    write pseudocode to represent the logic of a program that allows the user to enter a value for the radius of a circle. The program calculates the diameter by multiplying the radius by 2, and then calculates the circumference by multiplying the diameter by 3.14. The program outputs both the diameter and the circumference.

  • Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter two values

    # C++ Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter two values. The program outputs the sum of and the difference between the two values.

  • I need to Write a test program that prompts the user to enter 10 double values...

    I need to Write a test program that prompts the user to enter 10 double values into an array, calls a method to calculate the average of the numbers, and displays the average. Next, write a method that returns the lowest value in the array and display the lowest number. The program should then prompt the user to enter 10 integer values into an array, calculates the average, and displays the average. The program should have two overloaded methods to...

  • 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...

  • Write a program that asks the user to enter five test scores. The program should display...

    Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Score Letter Grade...

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