Question: NEED HELP UNDERSTNADING USING C#! using System; namespace Lab_Exercise_3 { class Hidden { private int number; public int GetValue() { return number; } public void

NEED HELP UNDERSTNADING USING C#! using System; namespace Lab_Exercise_3 { class Hidden { private int number; public int GetValue() { return number; } public void SetValue(int initiate) { number = initiate; } } class Program { static void Main(string[] args) { int number1 = 0; int number2 = 0; Random rnd = new Random(); int randomNumber = rnd.Next(100); Hidden unknown = new Hidden(); unknown.SetValue(randomNumber); Console.WriteLine("!!! Guess my number !!! "); Console.WriteLine("You have two chances to guess my number from the range 0 .. 99 "); Console.Write("Guess my number in the first attempt: "); number1 = int.Parse(Console.ReadLine()); if (number1 > unknown.GetValue()) { Console.WriteLine($"Your number {number1} is greater than mine by {number1 - unknown.GetValue()}"); } if (number1  

NEED HELP UNDERSTNADING USING C#! using System; namespace Lab_Exercise_3 { class Hidden

Your task in this Lab Exercise is to practice simple manipulation of objects combined with prompting users for input, getting input in from the users, storing user input in variables, using if statements. This is a 'code rewriting'-type exercise. You'll start with source code that we provide, and you make all necessary alterations. Requirements Application o Open Visual Studio o Create a new project with the name Lab Exercise_3 and the same solution name Lab_Exercise_3 o Copy/paste the content of the provided Lab_Exercise_3 text file completely replacing the content of predefined by Visual Studio default solution. o Your main tasks are: . execute the predefined solution, rewrite the content of class Hidden with the private instance integer variable number such that the public methods SetValue and GetValue are replaced with a public Number property (see figure 4.6 in Chapter 4 slides), rewrite the rest of the code to reflect alterations in class Hidden, ensure your final solution will save, build and run successfully

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!