ii. Suppose you have to make a game which 3 users can play. Write a function set_details that will ask the user to set their password. Then in main function you have to apply a loop upto 10 iterations in which the random number is generated between the range of 1-3. • Apply switch statement on the above generated random number to call the function of each player's total score. (Hint: You have to make a function for each player.) Now in the total score function the program should ask the user his password. If he enters correct password, then he is capable of entering a number form 1-9 otherwise the function will display wrong password. • • Finally, after terminating from the loop program should display the total numbers of each player.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.1: Function And Parameter Declarations
Problem 10E
icon
Related questions
Question
Solve in c programming language
ii. Suppose you have to make a game which 3 users can play.
Write a function set_details that will ask the user to set their password.
Then in main function you have to apply a loop upto 10 iterations in which the
random number is generated between the range of 1-3.
• Apply switch statement on the above generated random number to call the function of
each player's total score. (Hint: You have to make a function for each player.)
Now in the total score function the program should ask the user his password.
If he enters correct password, then he is capable of entering a number form 1-9
otherwise the function will display wrong password.
• Finally, after terminating from the loop program should display the total numbers of
each player.
Transcribed Image Text:ii. Suppose you have to make a game which 3 users can play. Write a function set_details that will ask the user to set their password. Then in main function you have to apply a loop upto 10 iterations in which the random number is generated between the range of 1-3. • Apply switch statement on the above generated random number to call the function of each player's total score. (Hint: You have to make a function for each player.) Now in the total score function the program should ask the user his password. If he enters correct password, then he is capable of entering a number form 1-9 otherwise the function will display wrong password. • Finally, after terminating from the loop program should display the total numbers of each player.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr