through c# Create a Console application that involves implementation of partial
ID: 663393 • Letter: T
Question
through c#
Create a Console application that involves implementation of partial classes. Under the first partial class, code a method that will generate a random value from 0 to 99. Within the other partial class, include a method that will accept 10 inputs from the user, and another one that will indicate if one of the input values is similar with the generated random value or not. Save under the project name
Consider the given output below.
Assume the random value is 19.
Generating random value
Explanation / Answer
/*generate random number*/
static void Main(string[] args)
{
int newArray = new int[10];
private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(0, 99);
}
Console.WriteLine("Please input 10 numbers. Press 'ENTER' after each number.");
for (int i = 0; i < 10; i++) {
newArray[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("The values you've entered are:");
Console.WriteLine(String.Join(", ", newArray));
Console.ReadLine();
int value1 = Array.Find(newArray,RandomNumber())
Console.WriteLine(value1);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.