Someone solve this question in C++ without using inline functions

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Someone solve this question in C++ without using inline functions 

In this task you have to make a Rock Paper Scissor game in which a user will play against computer. You willbe using
STL libraries <vector>, <ctime> and <cstdlib> in this assignment.
Create a class RockPaperScissor with the following private member:
Vector of users/usernames
Vector for number of wins for each corresponding user
Vector for number of losses for each corresponding user
Vector for number of draws for each corresponding user
And Public Members:
• Getters
• Setters
• Constructors
A play function
A leaderboard function to display leaderboard
Play function is where you will write all your game logic. You'll take an input from the user either rock, paper or
scissor in string. Then you'll generate a random number between 1 and 3 using <cstdlib> and <ctime> libraries and
map each number to a string. I used the following map but you're free to use your own.
1= Rock
2= Paper
3 = Scissor
Once you have a user entered input and computer generated string. Now you can make decisions on the basis of
rules of the game l.e. rock, paper, scissor. For example, if a user enters "Rock" and computer generates "Scissor",
user wins. You'll have to design your conditions for all cases including corner cases.
Five rounds will played between a user and computer. After five rounds, display the result of match to user based
on the total number of wins and losses. If the user wins, you'll update the index of vector for wins corresponding
to that user in user vector. Your vectors will be ordered in such a way that if userl is at index O in user vector, then,
the number of wins for user1 in wins vector will be at index 0 as well.
Once, the match of 5 rounds is over, ask the user if he wants to play again. If yes, play again, and if no, go back to
main menu.
In main function, first you will ask the user to log in or sign up in order to play the game, view leader board or quit.
If user selects sign up, take his entered username and add it to users vector. If user selects log in, search his
username in user vector, if he/she exists then allow him/her to play the game otherwise display an appropriate
error. If the user chooses to view leaderboard, display him all the names of users along with their number if wins,
losses,draws in a tabular form.
Transcribed Image Text:In this task you have to make a Rock Paper Scissor game in which a user will play against computer. You willbe using STL libraries <vector>, <ctime> and <cstdlib> in this assignment. Create a class RockPaperScissor with the following private member: Vector of users/usernames Vector for number of wins for each corresponding user Vector for number of losses for each corresponding user Vector for number of draws for each corresponding user And Public Members: • Getters • Setters • Constructors A play function A leaderboard function to display leaderboard Play function is where you will write all your game logic. You'll take an input from the user either rock, paper or scissor in string. Then you'll generate a random number between 1 and 3 using <cstdlib> and <ctime> libraries and map each number to a string. I used the following map but you're free to use your own. 1= Rock 2= Paper 3 = Scissor Once you have a user entered input and computer generated string. Now you can make decisions on the basis of rules of the game l.e. rock, paper, scissor. For example, if a user enters "Rock" and computer generates "Scissor", user wins. You'll have to design your conditions for all cases including corner cases. Five rounds will played between a user and computer. After five rounds, display the result of match to user based on the total number of wins and losses. If the user wins, you'll update the index of vector for wins corresponding to that user in user vector. Your vectors will be ordered in such a way that if userl is at index O in user vector, then, the number of wins for user1 in wins vector will be at index 0 as well. Once, the match of 5 rounds is over, ask the user if he wants to play again. If yes, play again, and if no, go back to main menu. In main function, first you will ask the user to log in or sign up in order to play the game, view leader board or quit. If user selects sign up, take his entered username and add it to users vector. If user selects log in, search his username in user vector, if he/she exists then allow him/her to play the game otherwise display an appropriate error. If the user chooses to view leaderboard, display him all the names of users along with their number if wins, losses,draws in a tabular form.
You are allowed to make as many helper functions in your class as you want for your convenience. It is strongly
recommended to make helper functions/methods.
Generating Random Number:
For generating random numbers, you can use srand() and rand() functions from <ctime> and <cstdlib> library. You
can find more on generating random numbers over internet.
Note: Do not use In line functions.
Transcribed Image Text:You are allowed to make as many helper functions in your class as you want for your convenience. It is strongly recommended to make helper functions/methods. Generating Random Number: For generating random numbers, you can use srand() and rand() functions from <ctime> and <cstdlib> library. You can find more on generating random numbers over internet. Note: Do not use In line functions.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY