Part A: Secret Number Guessing a secret number of the user is one of the most interesting games played around the world. In this part you are required to implement this game in MATLAB that follows the following rules:- • The computer chooses any secret number between given set limits. The user is asked to guess a number until secret number is guessed correctly by the user. At each guess, the computer responds with whether the guess by the user is: Higher than the secret number Equal to the secret number Less than the secret number Also, there are 5 levels in a game where the user is prompted to select any level to play. The levels are as described below:- - Level 1: User has to guess a secret number within range 1-10 Level 2: User has to guess a secret number within range 1-50 Level 3- User has to guess a secret number within range 1-100 Level 4- User has to guess a secret number within range 1-150 Level 5- User has to guess a secret number within range 1-200 Here, the MATLAB will think of a random number between a certain range and ask you to guess it. Important Features of the Game 1. Allow User to guess more than once. 2. Allow the user to play another game once the game is over. 3. Make sure that the number to guess isn't bigger than the maximum range of the level chosen by the user. For example, if a user is playing level 2, then he cannot guess number greater than 50. 4. Give a User hints (like prompting user that the secret number is bigger or smaller than their guess) 5. After finishing the level, a result is displayed to the user along with number of guesses needed by player to guess the secret the secret number and the overall result. 6. Based on the number of guesses and number 'n' in each level, result is displayed to the user. Here, 'n' is maximum number of chosen level, for example, for level 1, n=10, for level 2, n=50, for level 3, n-100, for level 4, n-150 and so on. The other details are as follows: -If number of guesses1, message, “Your Guess is Excellent" is displayed. - If number of guesses between 2 and less than 50% of n, message, "Your guess is good" is displayed. - If number of guesses is equal to 50% of the n, message "Your guess is Average" is displayed. - If number of guesses greater than 50% of n and less than or equal to 80% of n, message "Your guess is Poor" is displayed. -If number of guesses greater than 80% of n, message "You lost the game" is displayed.
Part A: Secret Number Guessing a secret number of the user is one of the most interesting games played around the world. In this part you are required to implement this game in MATLAB that follows the following rules:- • The computer chooses any secret number between given set limits. The user is asked to guess a number until secret number is guessed correctly by the user. At each guess, the computer responds with whether the guess by the user is: Higher than the secret number Equal to the secret number Less than the secret number Also, there are 5 levels in a game where the user is prompted to select any level to play. The levels are as described below:- - Level 1: User has to guess a secret number within range 1-10 Level 2: User has to guess a secret number within range 1-50 Level 3- User has to guess a secret number within range 1-100 Level 4- User has to guess a secret number within range 1-150 Level 5- User has to guess a secret number within range 1-200 Here, the MATLAB will think of a random number between a certain range and ask you to guess it. Important Features of the Game 1. Allow User to guess more than once. 2. Allow the user to play another game once the game is over. 3. Make sure that the number to guess isn't bigger than the maximum range of the level chosen by the user. For example, if a user is playing level 2, then he cannot guess number greater than 50. 4. Give a User hints (like prompting user that the secret number is bigger or smaller than their guess) 5. After finishing the level, a result is displayed to the user along with number of guesses needed by player to guess the secret the secret number and the overall result. 6. Based on the number of guesses and number 'n' in each level, result is displayed to the user. Here, 'n' is maximum number of chosen level, for example, for level 1, n=10, for level 2, n=50, for level 3, n-100, for level 4, n-150 and so on. The other details are as follows: -If number of guesses1, message, “Your Guess is Excellent" is displayed. - If number of guesses between 2 and less than 50% of n, message, "Your guess is good" is displayed. - If number of guesses is equal to 50% of the n, message "Your guess is Average" is displayed. - If number of guesses greater than 50% of n and less than or equal to 80% of n, message "Your guess is Poor" is displayed. -If number of guesses greater than 80% of n, message "You lost the game" is displayed.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Use Matlab please
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education