View the step-by-step solution to:

visual studio c# o make a 12-element array called months. Set each element to the name of each month. For example months[0] = "January"....

visual studio c# o


make a 12-element array called months. Set each element to the name of each month.

For example months[0] = "January". Use a for loop to display the number and name of each month.


Use an array initializer list to make a 4-element array to store the names of 4 seasons. Use a while loop to display the name of each season.


Use a for loop to output each of the values in the array names.


string[] names = { "Al Dente", "Anna Graham", "Earle Bird", "Ginger Rayle", "Iona Ford" };



Use a foreach loop to output each of the values in the array names.


string[] names = { "Al Dente", "Anna Graham", "Earle Bird", "Ginger Rayle", "Iona Ford" };



make an array of integers with 20 elements. Fill the array with random numbers. Use a foreach loop to print all integers in the array. The following code can be used to make a random number each time through the loop. Also, note that you will have 2 loops: 1 for loop to populate an array with random numbers and a second foreach to output each of the random values from the array.


Use this code to make a Random object called random. Put this code before the for loop.

Random random = new Random();

int randomNumber;

Use this code inside of your loop body to make a new random number each time through the loop:

randomNumber = random.Next(0, 100); // place this line in the loop

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question