Question: Create an application that will create a random number guessing game (1-100). Upon a guess you will determine if the guess is correct, too high,
Create an application that will create a random number guessing game (1-100). Upon a guess you will determine if the guess is correct, too high, too low and will display this back to the user. This will loop until the user guesses correctly at which time the application will display "Congratulations it took you x amount of tries to guess it". X=the number of tries it took
(I trying to work out a program on visual studio community but I cant make sense of what the error is? Please help!)



4 File Edit View Git Project Build Debug Format Test Analyze Tools Iteration Project LC Extensions Window Help Search (Ctrl+Q) - + = + =LTH || ||#Isl | 11 I noe Debug Any CPU Start - Live Share Form1.cs Form1.cs [Design] + X Program.cs X Solution Explorer 1 x -Go Diagnostic Tools - Guess Number X Server Explorer Toolbox Data Sources O Enter Guess Search Solution Explorer (Ctrl+;) Solution 'Iteration Project' (1 of 1 project) c# Iteration Project Properties H-1 References App.config 1 Form1.cs Form1.Designer.cs Form1.resx C# Program.cs Submit Enter Guess 1 - 100 Solution Explorer Git Changes 4 x Properties label1 System.Windows.Forms.Label A Minimum Size Modifiers Padding RightToLeft Size Tablndex Tag Text 0,0 Private 0,0,0,0 No 65, 13 4 Enter Gud Text The text associated with the control. Error List 'GuessNumber' declarations Output O Ready C 35,77 65 x 13 1 Add to Source Control - 2 File Edit View Build Debug Test Analyze Tools Extensions Window Help Search (Ctrl+Q) Iteration Project LC Git Project lore . Debug Any CPU Start - - 1 1? . Live Share 1 x Program.cs X Solution Explorer . GuessNumber_Load(object sender, EventArgs e) - + -Go Diagnostic Tools Server Explorer Toolbox Data Sources Search Solution Explorer (Ctrl+;) Solution 'Iteration Project' (1 of 1 project) C# Iteration Project Properties H-1 References 19 App.config 1 Form1.cs Form1.Designer.cs Form1.resx C# Program.cs Form1.cs + x Form1.cs [Design] C# Iteration Project Iteration_Project. GuessNumber 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms; 10 11 namespace Iteration_Project 12 { 2 references 13 public partial class Guess Number : Form 14 { 15 13 16 int randomnumber; 17 int trycounter = 0; 18 int guessnumber; 19 1 reference 20 public Guess Number() 21 { 22 InitializeComponent(); 23 } 24 1 reference 25 private void Guess Number_Load(object sender, EventArgs e) 26 { 27 if (trycounter Diagnostic Tools Server Explorer Toolbox Data Sources Form1.cs + x Form1.cs (Design) Program.cs X Solution Explorer C# Iteration Project Elteration_Project. GuessNumber . GuessNumber_Load(object sender, EventArgs e) + -Go 27 if (trycounter H-1 References 33 trycounter = trycounter = 1; 34 guessnumber = int.Parse(textBoxUser.Text); 19 App.config 35 if (guessnumber == randomnumber) 1 Form1.cs 36 { Form1.Designer.cs 37 Output. Text = "CONGRATULATIONS!! It took + trycounter + "tries to guess it"; Form1.resx 38 } C# Program.cs 39 else if (guessnumber > randomnumber) 40 { 41 Output.Text = "Your guess is too high"; 42 } 43 else if (guessnumber
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
