# Practice Writing Code with Loops Project

Upload Record Choose Existing You can upload files up to a maximum of 1 GB. Activity Details Task: Submit to complete this assignment Due April 17 at 11:59 PM Name Date Assignment Name public class codingLabe2 { public static void main(String[] args) { // create the floating-point numbers float first = 1.5f; float second = 2.0f; // multiple the two numbers float product = first * second; } } // print out the final product System.out.println(“The product is: ” + product); LAB 6 In this lab you will practice writing code with loops, including nested loops. Warm-up exercises:

1. •Write a program that adds numbers between 1 to 100 and prints the result. Do it three times, use for loop, then while loop, then do-while loop.

2. •Write a program that prints numbers from 0 down to -100. Use while loop.

3. •Write a program that adds numbers between 100 to 200 and prints the result. Use dowhile loop.

4. •Write a program that adds odd numbers between 1 to 100 and prints the result. Use while loop.

5. •Write a program that averages even numbers between 5 to 30 and prints the result. Use do-while loop. Nested for loops. Any of the loops you have learned could be nested within each other. Remember, that inside any loop we can have any statement (for example, printing statement is very common), including loop. One of the most common JAVA language constructs is having for loops nested two or three times. Here we are going to explore two for loops nested structure. Copy-paste and run the following example that uses nested for loops. int n = 5; for (int line = 1; line

Do you have a similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at EssayBell.com

Do you have a similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at EssayBell.com. We assure you of a well written and plagiarism free papers delivered within your specified deadline.