Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Loops Java loops are very simple! They follow a very simple syntax! A while loop will have the structure: while(condition) Statement 1; Statement 2:

image text in transcribed
1. Loops Java loops are very simple! They follow a very simple syntax! A while loop will have the structure: while(condition) Statement 1; Statement 2: ) A for loop has the structure: for(instantiation; condition; update) Statement 1: Statement 2: Always make sure you make an uplate after/before every iteration, and make sure that the loop will exit at some point, If it's difficult, trace your code line by line! Print out numbers from 1 to 10 using for loop and then do the opposite (10 to 1) using while loop Write a Java program that creates an array of random numbers and finds the smallest number in that array and displays it Write a Java program that calculates the average of numbers in the array: 2, 9, 4, 5, 15, 20

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions