Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a script named lab6s5 that plays a game with the user. When a user executes the script, they must keep guessing the secret number

Create a script named lab6s5 that plays a game with the user. When a user executes the script, they must keep guessing the secret number until they successfully enter it. Here is an example interaction with the script. Make sure that your script behaves identically:

$ ./lab6s5 I am thinking of a number between 1 and 10. Enter your guess:3 The secret number is larger than your guess. Try again. I am thinking of a number between 1 and 10. Enter your guess:6 The secret number is smaller than your guess. Try again. I am thinking of a number between 1 and 10. Enter your guess:2 The secret number is larger than your guess. Try again. I am thinking of a number between 1 and 10. Enter your guess:5 Yes! 5 is the correct answer!

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago