












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













if (radius >= 0) { area = radiusradiusPI; System.out.println("The area for the circle of radius " + radius + " is " + area); } else { System.out.println("Negative input"); }
switch (year) { case 7: interestRate = 7.25; break; case 15: interestRate = 8.50; break; case 30: interestRate = 9.0; break; default: System.out.println( "Wrong Year, enter 7, 15, or 30"); }
for Loops while Loops do Loops break and continue
Examples for using the for loop: Example 3.2: TestSum.java TestSum TestMulTable Example 3.3: TestMulTable.java Run Run
false true Statement(s) Next Statement Continue condition?
false true Statement(s) Next Statement Continue condition? Statement(s) continue
Examples for using the break and continue keywords: Example 3.5: TestBreak.java Example 3.6: TestContinue.java TestBreak TestContinue Run Run