A bowling alley is offering a prize to the bowler whose average score from bowling three games is the lowest. Write a pseudocode algorithm for a program that inputs three bowling scores and calculates and displays their average.

Short Answer

Expert verified
Answer: The sequence of steps in the pseudocode algorithm to calculate the average score of three bowling games is: 1. Input the scores of three bowling games (score1, score2, and score3). 2. Calculate the average by adding the scores and dividing the sum by 3 (average = (score1 + score2 + score3) / 3). 3. Display the calculated average score (PRINT "The average score is ", average).

Step by step solution

01

Input the bowling scores

In this step, we collect the scores of the three bowling games. We will use three variables (score1, score2, and score3) to store the input values. ``` INPUT score1 INPUT score2 INPUT score3 ```
02

Calculate the average

In this step, we calculate the average of the three bowling scores. To calculate the average, we add the three scores and then divide the sum by 3. We will use a variable (average) to store the calculated average. ``` average = (score1 + score2 + score3) / 3 ```
03

Display the average

In this final step, we display the calculated average score. ``` PRINT "The average score is ", average ``` The complete pseudocode algorithm is as follows: ``` INPUT score1 INPUT score2 INPUT score3 average = (score1 + score2 + score3) / 3 PRINT "The average score is ", average ```

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Write a multiple assignment statement that can be used instead of the following group of assignment statements: \\[ \begin{array}{l} \text { east }=1 ; \\ \text { west }=1 ; \\ \text { north }=1 \\ \text { south }=1 \end{array} \\]

Assume the following variables are defined: int age double pay: char section; Write a single cin statement that will read input into each of these variables.

Write a cout statement so the variable profit is displayed in a field of 12 spaces, in fixed-point notation, with a decimal point and four decimal digits.

inc… # Trace the following programs and tell what each will display. (Some require a calculator.) A) \(\text {(Assume the user enters } 38711 \text {. Use a calculator.})\) # include { iostream } using namespace std; int main ( ) \\{ double salary, monthly; cout \(<<\) "What is your annual salary? " \(\operatorname{cin} \quad>>\operatorname{salar} y\) month1y \(=\) static cast \(\langle\text { int }>(\text { salary ) } / 12\) cout \(<<\) "Your monthly wages are " \(<<\) monthly \(<<\) end1 return 0 B) #include using namespace std; int main () \\{ \\[ \begin{array}{l} \log g \quad x, \quad y, \quad z ; \\ x=y=z=4 \\ x+=2 \\ y-=1 ; \\ z \quad x=3 ; \\ \operatorname{cout}< using namespace std; # define WHO "Columbus" # define DID "sailed" #define WHAT "the ocean blue." int main () \\{ const int WHEN = 1492 cout \(<<\) "In \("<<\) WHEN \(<<\) " \("<<\) WHO \(<<\) " \\[ <

Write a cout statement so the variable divsales is displayed in a field of eight spaces, in fixed-point notation, with a decimal point and two decimal digits.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free