Question: If Statements: 3 . Define an integer variable called myNumber and assign it a value of your choice 4 . Write code using If Statements

If Statements:
3. Define an integer variable called myNumber and assign it a value of your choice
4. Write code using If Statements and the mod operator (%) to determine whether this number is even or odd
5. Display a message in the log.i such as 2 is even, or 3 is odd depending on myNumbers value
For Loops:
6. Define an integer variable called numberRows and assign it a value of your choice
7. Use the numberRows variable input to create a reverse pyramid in the Log.i. For example, if numberRows =5 then the output should look like this:
HINT: You will need to concatenate the string to do this since Log.i prints a new line
Your loop should have a String assignment with +=* and you print to the Log outside the inner loop
Methods:
8. Create a method called max which returns a double and takes two doubles as parameters
9. Write code inside the method to return the larger of the two parameters
e.g. If you pass in 4.12 and 6.12 it returns 6.12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!