MUST BE DONE IN CSHARP Create a RockPaperScissors Applicatio

MUST BE DONE IN CSHARP

Create a Rock-Paper-Scissors Application

Create a Class to contain the game data and any input or output methods. The main method should contain no Console methods, all functionality should be contained within the class.

The program will ask the user’s name, and the number of matches to play. This input needs to be validated as an odd number (in order to avoid ties), with a maximum value of 9.

The individual match results should be stored in an array.

The program will then prompt the user to choose rock, paper or scissors. It will generate a random value for the computer and declare a winner. In the case of a tie, that match will repeat until a winner is found.

After the number of matches specified above the program will provide a game summary for each match and the overall winner. For instance:

Match 1 (Player won) Rocks vs Scissors [after 3 ties] Match 2 (Computer won)…. Match 3 (Player won)… Overall winner: Player! Congratulations!

Solution

using System;

using System.Collections.Generic;

u0sing System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace rockpaperscissors{

class programapplication{

static void main(string[] args)

{

bool playing = true;

while(playing)

{

console.writeln(\"choose rock or paper or scissors\");

string userselection=Console.ReadLine();

Random ran = new Random();

int computerselection = ran.Next(4);

if(computerselction = = 1)

{

if(userselection== \"rock\")

{

Console.WriteLine(\"computer chooses rock\");

Console.WriteLine(\"both of you chose the same this is a tie\");

}

elseif(userselection == \"paper\")

{

Console.WriteLine(\"computer choses paper\");

Console.WriteLine(\"both of you chose the same this is a tie\");

}

else if(user selection == \"scissors\")

{

Console.WriteLine(\"computer choses scissors\");

Console.WriteLine(\"both of you chose the same this is a tie\");

}

else

{

Console.WriteLine(\"rock,paper or scissors must be choosen\");

}

}

else if(ccomputer selection==3)

{

if(user selection ==\"rock\")

{

Console.WriteLine(\"computer choses rock\");

Console.WriteLine(\"you win\");

}

else if(user selection ==\"paper\")

{

Console.WriteLine(\"computer choses rock\");

Console.WriteLine(\"you win\");

}

else if(user choice ==\"scissors\")

{

Console.WriteLine(\"computer choses scissors\");

Console.WriteLine(\"you win\");

}

else

{

Console.WriteLine(\"you must choose rock,or paper or scissors\");

}

}

Console.WriteLine(\"New gane?y/n\");

ConsoleKeyInfo cki=Console.ReadKey();

playing = cki.keyc

}

}

MUST BE DONE IN CSHARP Create a Rock-Paper-Scissors Application Create a Class to contain the game data and any input or output methods. The main method should
MUST BE DONE IN CSHARP Create a Rock-Paper-Scissors Application Create a Class to contain the game data and any input or output methods. The main method should
MUST BE DONE IN CSHARP Create a Rock-Paper-Scissors Application Create a Class to contain the game data and any input or output methods. The main method should

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site