Reference no: EM132206668
Write one Java application based on the following directions and algorithms. Make sure the results from each of the numbered items is separate and easy to read/understand.
1.Use a For loop to compute the sum of all the odd numbers from 1 through 99. Your result should be labeled, and the value should be 2500.
2.Print your name 7 times using a While loop.
3.String dogNames[ ] = {"Fido","Buster","Fifi","Patches","Gromit","Toodles"};
Using the array defined here, print the values of the array vertically and horizontally using one For-Each loop.
4.Reverse the logic for zyBook Challenge activity 4.6.1 (Nested loops: Indent text) so that the first line is indented userNum number of spaces and the subsequent lines are each indented one less space until the last value is not indented at all (‘s' indicates one space):
sssss5
ssss4
ss2
s1
0
5.String method practice:
Create a String variable that contains your full name
Repeat the following steps 5 times:
Generate a random number between 1 and 4.
If number is 1, display your name in all upper case.
If number is 2, display your name in all lower case.
If number is 3, replace your first name with "Three" and display your name.
If number is 4, display the character at index 4.