. Create a generic collection that stores even numbers from 2 to 20.
Display only the first element of the List.
.Create a delegates that accepts a number from user and displays whether the number is even or odd.
1. Create a delegate that displays a message (" you are underage" ) if the user's age is less than 18 and (you qualify to be an adult") if the age is greater than 18.
Create a struct named Product where its fields are code, description, and price.
1. Create a method named getCircleDiameter that takes a radius of double type as the parameter. The method should return the diameter of a circle. To compute the diameter of a circle, multiply the radius by 2.
2.Create a struct named Product where its fields are code, description, and price.
Create a class named Person with an instance variable named full_name. Declare one (1) constructor without a parameter and initialize the variable with a default value.
3.Create a class named Account with an instance variable named account_number. Make this class a member of the Accounts namespace.
)Write a program that generates a random number between 1 and 10 inclusive. Ask a user to guess the random number, then display a message indicating whether the user’s guess was too high, too low, or correct.
• The message “Sorry – your guess was too low!” should be displayed if the number entered by the user is lower than the random number generated
• The message “Sorry – your guess was too high!” should be displayed if the number entered by the user is higher than the random number generated.
• The message “Congratulations – your guess is correct!” should be displayed if the number entered by the user matched the random number generated.
The user is given up to 3 attempts to guess.
• If the user did not successfully guess the random number after 3 attempts, display: “The random number was X” (X is the random number).
• If the user successfully guesses the random number within 3 attempts, display: “You guessed the number on attempt number X” (X is the attempt count).
)Write a program that generates a random number between 1 and 10 inclusive. Ask a user to guess the random number, then display a message indicating whether the user’s guess was too high, too low, or correct.
• The message “Sorry – your guess was too low!” should be displayed if the number entered by the user is lower than the random number generated
• The message “Sorry – your guess was too high!” should be displayed if the number entered by the user is higher than the random number generated.
• The message “Congratulations – your guess is correct!” should be displayed if the number entered by the user matched the random number generated.
Given months and temperature (in ºC) data as shown in the code snippet below:
string[] month = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec" };
double[] temperature = { 3.0, 5.6, 9.7, 13.8, 19.0, 24.5, 26.0, 25.0,
21.3, 14.6, 7.6, 2.8 };
a) Determine the temperature classification based on the table given.
Temperature Classification Temperature Range
Freezing < 0 ºC
Very Cold 0 ºC – 5.9 ºC
Cold 6 ºC – 9.9 ºC
Cool 10 ºC – 13.9 ºC
Mild 14 ºC – 17.9 ºC
Moderate 18 ºC – 22.9 ºC
Warm 23 ºC – 26.9 ºC
Very Warm 27 ºC – 29.9 ºC
Hot > 30 ºC
b) Determine the minimum and maximum value from the array of temperature
given. Subsequently, compute the average mark (rounded to 2 decimal
places).
Account numbers sometimes contain a check digit that is the result of a mathematical calculation. It is used to help ascertain whether the number is a valid one. Develop a simple C# application that asks a user to enter a four-digit account number and determines whether it is a valid number. The number is valid if the fourth digit is the remainder when the number represented by the first three digits of the four-digit number is divided by 7. For example, 7770 is valid, because 0 is the remainder when 777 is divided by 7.