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

include ; using namespace std; main { double number, half; cout \(<<\) "Enter a number and I will divide it $\backslash n^{\prime \prime}\( cout \)<<$ "in ha… # A) # include ; using namespace std; main { double number, half; cout \(<<\) "Enter a number and I will divide it \(\backslash n^{\prime \prime}\) cout \(<<\) "in half for you. \(\backslash n^{\prime \prime}\) $\operatorname{cin} \quad>>$ number 1 half \(=/ 2\) } B) \(\quad\) #include \(<\) iostream \(>\) using namespace std; int main ( ) \\{ char name, go cout \(<<\) "Enter your name: \("\) cin \(.\) width (20) cin. getline \(>>\) name cout \(<<\) "Hi \("<<\) name \(<<\) endl cout "Press the ENTER key to end this program." \(\operatorname{cin} \quad>>\operatorname{gof}\) return 0 \(f\)

Assume a string object has been defined as follows: string description; A) Write a cin statement that reads in a one word description. B) Write a statement that reads in a description that can contain multiple words separated by blanks.

Pet World offers a \(15 \%\) discount to senior citizens. Write a pseudocode algorithm for a program that inputs the amount of a sale, then calculates and displays both the amount the customer saves and the amount they must pay.

Assume the array name is defined as follows: char name [25] A) Using a stream manipulator, write a cin statement that will read a string into name, but will read no more characters than name can hold. B) Using the getline function, write a cin statement that will read a string into name but that will read no more characters than name can hold.

Assume a program has the following variable definitions int units; float mass ; double weight; and the following statement: weight \(=\) mass \(*\) units Which automatic data type conversions will take place?

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