Write a c++ program to prompt the user to enter his name. The program should ask the user to guess the login password (generated randomly to be between 1000 – 9999). The user will try to guess the password digit by digit as follows: Guess the first digit of the password ****: 2 Sorry wrong guessing!!!. Guess the first digit of the password ****: 1 WOW you have a correct guess. Guess the second digit of the password 1***: 5 WOW you have a correct guess. Guess the third digit of the password 15**: 3 Sorry wrong guessing!!!. The user will have only three chances to guess a specific digit from the password. After 3 successive wrong guesses a $50 balance will be deduced from the user balance. For each correct guessing a $100 dollar will be added to his balance if it is a correct guess from the first trial, and a $75 dollar will be added to his balance if it is a correct guess from the second trial. Note that the user is granted a balance of $200 dollar on the game start. The user win a game round if he was able to guess the login password, he looses otherwise. At the end of the game the user should be prompted about his balance. The program should allow many rounds of the gam
Write a c++ program to prompt the user to enter his name. The program should ask the user to
guess the login password (generated randomly to be between 1000 – 9999). The user will try
to guess the password digit by digit as follows:
Guess the first digit of the password ****: 2
Sorry wrong guessing!!!.
Guess the first digit of the password ****: 1
WOW you have a correct guess.
Guess the second digit of the password 1***: 5
WOW you have a correct guess.
Guess the third digit of the password 15**: 3
Sorry wrong guessing!!!.
The user will have only three chances to guess a specific digit from the password. After 3
successive wrong guesses a $50 balance will be deduced from the user balance. For each correct
guessing a $100 dollar will be added to his balance if it is a correct guess from the first trial,
and a $75 dollar will be added to his balance if it is a correct guess from the second trial. Note
that the user is granted a balance of $200 dollar on the game start.
The user win a game round if he was able to guess the login password, he looses otherwise. At
the end of the game the user should be prompted about his balance. The program should allow
many rounds of the game.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 5 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)