pseudo code for the java assignment
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
pseudo code for the java assignment
![Driver Class - RandomNumberGuesser
Student created
This is the driver class for RNG that contains a main method.
The driver is responsible to:
o print a header
ask the user for an initial guess of the Random Number between 0 and 100.
Print out the result for that guess using the methods from the RNG class.
Allow user to give another guess between the previous low and high guesses.
o Display the number of guesses
When user guesses correctly, ask if the user wants to try another round.
Print the Programmer's name at the end
Refer to the program sample run for more clarification.
For testing, you may print out the randomly-generated number.
In comments, list the author's name (yours)
Data Validation. The following data is validated by the RNG method ipputValidation
Guesses must be an integer between the previous low guess and high guess.
Naming.
There should be an attribute named randNum
There should be attributes named nextGuess, bighGuess, and lowGuess
Add any necessary methods to modularize your code.
Assignment Details
Your program should respond similar to the following sample runs:
Example Run 1 (one iteration)
Enter your first guess
99
Number of guesses is 1
Your guess is too high
Enter your next guess between e and 99
66
Number of guesses is 2
Your guess is too low
Enter your next guess between 66 and 99
73
Number of guesses is 3
Congratulations, you guessed correctly
Try again? (yes or no)
no
Thanks for playing...](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F63a2ecd4-d40e-4f58-bfeb-302941b5ae7f%2Fab4c58b0-ac7f-448d-8160-18062deecaeb%2F2ft5rvp_processed.png&w=3840&q=75)
Transcribed Image Text:Driver Class - RandomNumberGuesser
Student created
This is the driver class for RNG that contains a main method.
The driver is responsible to:
o print a header
ask the user for an initial guess of the Random Number between 0 and 100.
Print out the result for that guess using the methods from the RNG class.
Allow user to give another guess between the previous low and high guesses.
o Display the number of guesses
When user guesses correctly, ask if the user wants to try another round.
Print the Programmer's name at the end
Refer to the program sample run for more clarification.
For testing, you may print out the randomly-generated number.
In comments, list the author's name (yours)
Data Validation. The following data is validated by the RNG method ipputValidation
Guesses must be an integer between the previous low guess and high guess.
Naming.
There should be an attribute named randNum
There should be attributes named nextGuess, bighGuess, and lowGuess
Add any necessary methods to modularize your code.
Assignment Details
Your program should respond similar to the following sample runs:
Example Run 1 (one iteration)
Enter your first guess
99
Number of guesses is 1
Your guess is too high
Enter your next guess between e and 99
66
Number of guesses is 2
Your guess is too low
Enter your next guess between 66 and 99
73
Number of guesses is 3
Congratulations, you guessed correctly
Try again? (yes or no)
no
Thanks for playing...
![Assignment Deseription
Build an application that will receive a guess and report if your guess is the random
number that was generated. Your application will narrow down the choices according to
your previous guesses, and continue to prompt you to enter until you guess correctly.
Notice that if you divide the choices in half each iteration, you will need at most
log2(100) ~ 7 guesses.
You will use the utility class RNG.java.
Concepts tested by this assignment
A driver and a utility class
UML class diagrams or pseudo-code
Java fundamentals, including decision structures, loops
Selection control statements
Repetition control statements
Input validation loops (in RNG.java)
Relational and logical operators
Random number generation (in RNG.java)
Classes
Data Element Class – RNG
Provided
This file will generate a random number between 1 and 100
Note that the method "rand" is a static method, so the java file does not need to be instantiated to
use it. Call rand with the following: RNG rand(100) to generate a random number between 0
and 99.
Study this class. You will want to use four methods from this class: rand, resetCount getCount
and inputValidation](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F63a2ecd4-d40e-4f58-bfeb-302941b5ae7f%2Fab4c58b0-ac7f-448d-8160-18062deecaeb%2Fo2tip7o_processed.png&w=3840&q=75)
Transcribed Image Text:Assignment Deseription
Build an application that will receive a guess and report if your guess is the random
number that was generated. Your application will narrow down the choices according to
your previous guesses, and continue to prompt you to enter until you guess correctly.
Notice that if you divide the choices in half each iteration, you will need at most
log2(100) ~ 7 guesses.
You will use the utility class RNG.java.
Concepts tested by this assignment
A driver and a utility class
UML class diagrams or pseudo-code
Java fundamentals, including decision structures, loops
Selection control statements
Repetition control statements
Input validation loops (in RNG.java)
Relational and logical operators
Random number generation (in RNG.java)
Classes
Data Element Class – RNG
Provided
This file will generate a random number between 1 and 100
Note that the method "rand" is a static method, so the java file does not need to be instantiated to
use it. Call rand with the following: RNG rand(100) to generate a random number between 0
and 99.
Study this class. You will want to use four methods from this class: rand, resetCount getCount
and inputValidation
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education