Hello I need help with this homework This assignment involve
Hello, I need help with this homework:
This assignment involves loops:
1. Create a for loop that displays 10 random numbers. Random is an object that produces a random number. Below is a piece of code that produces a random number between 1 and 50:
_____________________________________
_____________________________________
2. Create a for loop that counts down (and displays the count) from 10 to 0.
3. Create a while loop that displays the count of the loops and then asks the user whether they want to continue or not. If yes, then continue; if no the program should end and display a a note saying thank you.
4. Create a do loop that runs until a user enters \"Stop.\"
Using visual studio 2015 C# language.
Thank you.
Solution
1) Random rand = new Random();
for (int i = 0; i < 10; i++)
{
Console.WriteLine(rand.Next(1, 501));
}
2)
for (int i = 10; i >=0; i--)
{
c++;
}
Console.WriteLine(c);
3)
