Write an application that generates a random number that players determine wheth
ID: 3647923 • Letter: W
Question
Write an application that generates a random number that players determine whether they were correct and display a message indicating whether the player's guess is correct, too high or too low. Add a loop that continuously prompts the user for the number, indicating whether the guess is high or low, until the user enters the correct value. After the user correctly guesses the number, display a count of the number of attempts it took. Make it so the player has to pick between 1 and 1000. Once the player has figured out the correct number, ask if they would like to play again using the Scanner class. If yes, restart the game with a new random number. If not, use the System.out.println(); method to display a message that thanks the user for playing the game.Explanation / Answer
#include #include using namespace std; unsigned int PRNG() { // our initial starting seed is 5323 static unsigned int nSeed = 5323; nSeed = (8253729 * nSeed + 2396403); return nSeed % 32767; } int main() { for (int nCount=0; nCount < 100; ++nCount) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.