If you haven’t done so already, fork and clone csharp-web-dev-lsn2controlflowandcollections. Work on these exercises in this solution and create a new class for each item. You may call these classes whatever you like, but remember to use the proper C# naming conventions.
Create and initialize an array with the following values in a single line:
1, 1, 2, 3, 5, 8
Loop through the array and print out each value.
Modify the loop to only print the odd numbers from the array.
For this exercise, create a string for the value:
I would not, could not, in a box. I would not, could not with a fox.
I will not eat them in a house. I will not eat them with a mouse.
Use the Split
method to divide the string at
each space and store the individual words in an array. If you need to review
the method syntax, look back at the string methods
table.
Print the array of words to verify that your code works. The syntax is:
Console.WriteLine(string.Join(",", arrayName));
Repeat steps 2 and 3, but change the delimiter to split the string into separate sentences.
Main
, create a list with at least 10 integers and call
your method on the list.Make a program similar to GradebookDictionary
that does the following:
List
collection.