Question

Determine the average of test scores. When completing this question, remember the order of operations. Write...

Determine the average of test scores. When completing this question, remember the order of operations. Write a program that calculates an average of five test scores. The output will display the average test score.

Get the first test score.

Get the second test score.

Get the third test score.

Get the fourth test score.

Get the fifth test score.

Calculate the average by adding 5 test scores and dividing the sum by 5.

Display the average.

Make sure you add comments to each step.

in the average = area, you will concat scores and finish the arithmetic as stated above.

Write the Program that displays the output below:

Enter the first test score: 90
Enter the second test score: 80
Enter the third test score: 70
Enter the fourth test score: 90
Enter the fifth test score: 100
The average test score is: 86.0

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

You didn't mention the programming language.So, i write in java langauge.

Code :

import java.lang.*;

import java.util.*;

public class Main
{

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in); //to take the input from user

       int first,second,third,fourth,fifth; //initialize variables
       float avg;
System.out.print("Enter the first test score : ");
       first = sc.nextInt(); //taking first score from user
       System.out.print("Enter the second test score : ");
       second = sc.nextInt(); //taking second score from user
       System.out.print("Enter the third test score : ");
       third = sc.nextInt(); //taking third score from user
       System.out.print("Enter the fourth test score : ");
       fourth = sc.nextInt(); //taking fourth score from user
       System.out.print("Enter the fifth test score : ");
       fifth = sc.nextInt(); //taking fifth score from user
       avg = (first+second+third+fourth+fifth)/5; // finding the average of scores
       System.out.println("The average test score is : " +avg); //print the average
   }
}

Main.java - Notepad File Edit Format View Help import java.lang.*; import java.util.*; public class Main{ public static void

- Notepad C:\Windows\system32\cmd.exe Microsoft Windows [Version 6.3.9600] © 2013 Microsoft Corporation. All rights reserved.

python :

first = int(input("Enter the first test score : "))
second = int(input("Enter the second test score : "))
third = int(input("Enter the third test score : "))
fourth = int(input("Enter the fourth test score : "))
fifth = int(input("Enter the fifth test score : "))
avg = (first+second+third+fourth+fifth)/5
print("The average test score is : ",avg)

0 C Chegg х - Online Python Compiler - online X + C onlinegdb.com/online_python_compiler : Apps Settings MEmu - The Best Fr..0 C Chegg х - Online Python Compiler - online X + onlinegdb.com/online_python_compiler : Apps Settings Memu - The Best Fr...

I write the code in python

PLEASE UPVOTE

Add a comment
Know the answer?
Add Answer to:
Determine the average of test scores. When completing this question, remember the order of operations. Write...
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
  • Small Basic Programming Question: Average Score- Write a program that uses loop to collect data and...

    Small Basic Programming Question: Average Score- Write a program that uses loop to collect data and calculate the average score over a number of tests for a number of students. The program should: 1. first ask the user to enter the number of students in the range of 1 to 10. 2. then the program asks the user to enter the number of tests (in the range of 1 to 5) 3. Then use a loop to collect the scores...

  • Small Basic Programming Question: Average score Write a program that uses loops to collect data and...

    Small Basic Programming Question: Average score Write a program that uses loops to collect data and calculate the average score over a number of tests for a number of students. The program should : 1. first ask the user to enter the number of students in the range of 1 to 10. 2. then the program asks the user to enter the number of tests (in the range of 1 to 5) 3. Then use a loop to collect the...

  • in C++ Create a program that will calculate a student’s grade average of 5 test scores...

    in C++ Create a program that will calculate a student’s grade average of 5 test scores and assign a letter grade for a student. The program should use a class to store the student’s data including the student’s name and score on each of 5 tests. The program should include member functions to 1) get the student’s test scores, 2) calculate the average of the test scores, and 3) display the results as follows: Test scores for Mary: 100 90...

  • Write a Python program that asks the user to type in their three quiz scores (scores...

    Write a Python program that asks the user to type in their three quiz scores (scores between 0 and 100) and displays two averages. The program should be written so one function gets the user to input a score, another function takes the three scores and returns the average of them. And another function takes the three scores and averages the two highest scores (in other words, drops the lowest). Each of these functions should do the computation and return...

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

  • Test Scores and Grade Write a program that has variables to hold three test scores. The...

    Test Scores and Grade Write a program that has variables to hold three test scores. The program should ask the user to enter three test scores and then assign the values entered to the variables. The program should display the average of the test scores and the letter grade that is assigned for the test score average. Use the grading scheme in the following table: Test Score Average Letter Grade 90–100 A 80–89 B 70–79 C 60–69 D Below 60...

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

  • In C programming Write a program that displays the appropriate prompt to input 5 scores. Once...

    In C programming Write a program that displays the appropriate prompt to input 5 scores. Once the user inputs the five integer values, your program calculates and prints the average. You do not need to declare five different variables, think of how you can get away with a single variable. The second part of this program will print A if the average of these 5 numbers is greater than or equal to 90 but less than 100, B if greater...

  • Write a program that will ask the user to enter 4 quiz scores. These scores should...

    Write a program that will ask the user to enter 4 quiz scores. These scores should be from 0 to 100. Use a procedure and pass by reference to get these scores. Write a function that will find the lowest score. This score will be sent back through the function call. You still need to pass the scores by value to this function. Write a function that will calculate the average score. This value will be sent back to main...

  • Write a program to calculate students’ average test scores and their grades. You may assume the...

    Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...

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
Active Questions
ADVERTISEMENT