Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 2: Expand the guessing game from the first assignment. Expand the range to be 1 to 20 and allow the user to a maximum

image text in transcribed
image text in transcribed
Program 2: Expand the guessing game from the first assignment. Expand the range to be 1 to 20 and allow the user to a maximum of 5 attempts to guess it. The game ends when the user has guessed the correct number (a win) or the number of incorrect guesses has reached 5 (a loss). At the end of each game, users should be told whether they won or lost. To make the game more interesting, the program should vary the wording of the messages that it outputs for winning, for losing, and for asking for another game.Create at least 2 different messages for each of these cases, and use random numbers to choose among them After printing out the win/loss messages, ask the user whether they want to play again and have them answer y' or 'n'. When the user quits with the 'n' answer, the program should output the total number of wins and losses. If they answer 'y', then a new random number should be generated and they will of course, have 5 attempts again to guess the number. Here's some pseudo code that describes the outerloop of game control. set answer to 'y while the answer is 'y' do the following steps

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions

Question

If f (x, y) = x3y + 4xy4, find 2/x2 f (x, y) |(1, -1)

Answered: 1 week ago

Question

define EFFECTIVE PARTICIPATION

Answered: 1 week ago