Question
Purpose To create a program in C# that will simulate a Leprechaun Tug O War competition! . Topics of Evaluation Obtaining and displaying information Sequential
Purpose To create a program in C# that will simulate a Leprechaun Tug O War competition!
.
Topics of Evaluation
Obtaining and displaying information
Sequential processing
Decision processing
Loops
Requirements
Create a model for the program by drawing a flowchart or writing the pseudo code for the program. Pseudo code could be written as comments in your code.
Test your code. If mistakes are discovered, correct the model and the code.
Validation of input is required. Loop until the valid data is entered.
Player string is 3 characters long
Starting position must be at least 20
Play again must be Y/N (any case must be accepted)
How it works:
In the competition, the user will be asked to provide a string for each Leprechauns player The Rope will always be 10 characters long. The user will be prompted for the location of Leprechaun 2 to start the round. Research the use of string.PadLeft() to assist you.
The user will hit the enter key to generate a random number between 1 and 5 for each of the Leprechauns. The Leprechaun with the highest roll value will pull the other Leprechaun the spaces which is the difference between the 2 rolls. For example, if Leprechaun 1 rolls a 5 and Leprechaun 2 rolls a 3, Leprechaun 1 pulls the other Leprechaun 2 spaces towards the pit which is identified by ||.
A winner is decided when the front of one Leprechaun is pulled into the pit. If there is no winner after 10 pulls then it is a draw and the round is over.
After a round, the user will be asked if they would like to do another round. If they say Y (any case) perform another around. If they enter anything other than Y display the number of wins for each Leprechaun and the number of draws.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started