Question

In: Computer Science

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

Write this in pseudocode.

Solutions

Expert Solution

The pseudocode is as follows:

// The variables A (array of size 15), min, max, sum, average are initialized.

Declare A[15], min = 0, max = 0, sum = 0 average = 0

//Read the 15 elements in the array A

for

      read(A[i])

// Let the first element of the array be the minimum and maximum element

min = A[0]

max = A[0]

// For each element in the array, if there exists any element which is less than the

// first element, it becomes the minimum element.

for

      if A[i] < min

          min A[i]

// For each element in the array, if there exists any element which is greater than the

// first element, it becomes the maximum element.

      if A[i] > max

          max A[i]

// Add all the elements of the array A

      sum sum + A[i]

// Increment the counter

      ii+1

// Compute the average by dividing the sum by 15

average = sum/ 15

//Print the maximum, minimum and average.

print max

print min

print average


Related Solutions

Design the logic for a program that has two parts: The user enters 15 numbers that...
Design the logic for a program that has two parts: The user enters 15 numbers that are stored into an array. The program uses the array to display the numbers back to the user in reverse order. You must use an array and one or more loops to get full credit. Can someone please help me figure this out?
Design the logic for a program that allows a user to enter 20 numbers, then displays...
Design the logic for a program that allows a user to enter 20 numbers, then displays them in the reverse order of entry. Design the logic for a program that allows a user to enter 20 numbers, then displays each number and its difference from the numeric average of the numbers entered. The program is C++. I need a Pseudocode
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. Write the following methods in the program: calcAverage: This method should accept five test scores as arguments and return the average of the scores. determineGrade: This method should accept a test score as an argument and return a letter grade for the score, based on the following grading scale: Score Letter Grade 90-100...
Create a C++ program that will ask the user for how many test scores will be...
Create a C++ program that will ask the user for how many test scores will be entered. Setup a while loop with this loop iteration parameter. (no fstream) The data needs to include the student’s first name, student number test score the fields should be displayed with a total width of 15. The prompt should be printed with a header in the file explaining what each is: ex. First Name student number Test Score 1) mike 6456464   98 2) phill...
write a program in c++ that asks the user to enter their 5 test scores and...
write a program in c++ that asks the user to enter their 5 test scores and calculates the most appropriate mean. Have the results print to a text file and expected results to print to screen.
Instructions Write a Java program that asks the user t enter five test scores. The program...
Instructions Write a Java program that asks the user t enter five test scores. The program should display a letter grade for each score and the average test score. Write the following methods in the program: * calcAverage -- This method should accept five test scores as arguments and return the average of the scores. * determineGrade -- This method should accept a test score as an argument and return a letter grade for the score, based on the following...
C++ program that will ask the user for how many test scores will be entered. Setup...
C++ program that will ask the user for how many test scores will be entered. Setup a while loop with this loop iteration parameter. The data will include the student’s first name and midterm score Print out the completed test scores to a file (midTermScores.txt) . Print out list of students names and grades in the print out, a letter grade should replace numeric score using standard grading (a = 90 – 100, b=80-90, c=70-80, d=60-70, f=below 60)
Write a program that will find the class average of fifteen (15) test scores for five...
Write a program that will find the class average of fifteen (15) test scores for five (5) different tests. The class average must be stored into an integer array. You are to have three separate arrays: Note: _jd represents the initials of the programmer. Your array and function names should be named by replace the initials jd with your first and last initials Arrays Student Names Scores Averages Name of array students_jd scores_jd averages_jd Size of array [15][10] [15][5] .[5]...
Design JavaFX application with 7 labels and one textfield where user enters input inches.  When user enters...
Design JavaFX application with 7 labels and one textfield where user enters input inches.  When user enters his choice and presses enter key to complete input, program outputs resulting yards, feet, and inches.   Use class P5 that extends Application  with start method in it, and class P5Pane that extend GridPane. The only inctance variables for P5Pane class are inputInches where user enters input  inches, and three labels: outYards, outFeet, and outInches where program displays result of conversion.  Use the following names for instance variables:...
Write a program that asks the user to type in two integer values. Test these two...
Write a program that asks the user to type in two integer values. Test these two numbers to determine whether the first is evenly divisible by the second and then display the appropriate message to the terminal. Objective C
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT