Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for Java please follow the instructions on given practice excercise Page Objective This assignment will demonstrate your knowledge of loops, classes, methods, and

This is for Java please follow the instructions on given practice excercise image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Page Objective This assignment will demonstrate your knowledge of loops, classes, methods, and Java data types About You will write a Java program to play the game of Pico, Fermi, Bagel Rules: Here are the rules of the game 1. The computer will generate a "secret* three digit number at random. 2. The first number will not be 0, and all the digits will be different 3. The user tries to guess the number If the user guesses correctly, then the game is over If not, the computer gives a hint and the player tries again. . Hints: . For each digit that matches the secret number in the proper place, the computer prints Fermr For each digit that matches, but not in the proper place, the computer prints "Pico .If none of the digits match, the computer prints "Bagels Examples (If the program generated the secret number 482): Hi, I have a number on mind, guess that number? guess -637. Bagels quess -381, Fermi guess 382. Fermi Fermi guess 832, Fermi Pico quess 328, Pico Pico quess 428. Fermi Pico Pico guess 482, Winner! Game is over) When the game is over, the results are printed: whether the user won or quit, and the number of guesses made To avoid making it too easy for the player, you shoukd print all Fermis first, and then the Picos, for each guess To avoid making it too difficult, print all guesses and hints to System out so the user can scroll through them. Your Bagels class will have only one public method, playGame () This method will call three other methods to 1. Generate the secret number 2. Determine whether the curent guess is a winner 3. Evaluate the current guess and print hints Page Objective This assignment will demonstrate your knowledge of loops, classes, methods, and Java data types About You will write a Java program to play the game of Pico, Fermi, Bagel Rules: Here are the rules of the game 1. The computer will generate a "secret* three digit number at random. 2. The first number will not be 0, and all the digits will be different 3. The user tries to guess the number If the user guesses correctly, then the game is over If not, the computer gives a hint and the player tries again. . Hints: . For each digit that matches the secret number in the proper place, the computer prints Fermr For each digit that matches, but not in the proper place, the computer prints "Pico .If none of the digits match, the computer prints "Bagels Examples (If the program generated the secret number 482): Hi, I have a number on mind, guess that number? guess -637. Bagels quess -381, Fermi guess 382. Fermi Fermi guess 832, Fermi Pico quess 328, Pico Pico quess 428. Fermi Pico Pico guess 482, Winner! Game is over) When the game is over, the results are printed: whether the user won or quit, and the number of guesses made To avoid making it too easy for the player, you shoukd print all Fermis first, and then the Picos, for each guess To avoid making it too difficult, print all guesses and hints to System out so the user can scroll through them. Your Bagels class will have only one public method, playGame () This method will call three other methods to 1. Generate the secret number 2. Determine whether the curent guess is a winner 3. Evaluate the current guess and print hints

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions