Checkout
checkout
view
Your Cart Your Cart: item(s)
Subjects -> Computer Science -> Other -> Posting #51150
Add to Shopping Cart
$2.19 Instant Download
Computer Science, Other
Year 3

Java Programming


Loop Assignment:

Uses a while loop to count down every odd number from 40 to 0, printing each off number down to zero, except the number 3 and 33.  Program must use a continue and an if statement.

This is what I have so far but I am unable to get the continue statement to work with the program.  Please help...Thanks.

public class counter
{

  public static void main(String args[])
  {
    int counter = 40;

    while(counter >= 0)
    {
        if (counter % 2 == 1)
             System.out.println(counter + " ");
             counter--;
    }

  }
}

By OTA:  Suraj Joshi, PhD (IP)

OTA Rating:  4.7/5

Your Price:  $2.19  (original value ~$3.99)

What's included:

  • Plain text response
  • Attachment(s):
    • LOOP.zip
$2.19 Download Add to Cart

Add to Shopping Cart
$2.19 Instant Download
Java Programming - Write a GUI Java program that plays a guessing game with the user. The user will first enter a number between 1-10 OR letters between A-K (uppercase) and your program will generate a random number in the same range OR a letter to compare to the user's input, and declare whether you have matched each other or not. The program must do the following: 1. Interact appropriately w...
Java Programming - Write a GUI program which incorporates a try-catch block to error check your input for integers and alphabetic characters other than Y or N. Your program must include two interactions. Each interaction will ask the user at least two questions, both of which require a yes/no response (Y or N). The program flow will depend on both user responses. Your program must include at minim...
Java Programming - Write a complete interactive Java GUI program(for example: javax.swing.JOptionPane;) NOT A APPLET that requests two numbers from the user. The first number is the row dimension and the second number is the column dimension. Print to the user a rectangle of stars based on the input. The program must do the following: 1. Print the rectangle of stars. 2. Error check for bad inp...
Loop Commands with Java - 1. Write a Java program that demonstrates the following: Use a while loop to count down from 20 to zero, printing each number down to zero.
C ++ Exercise - I need a C++ program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of the type studentType, which has ...

Page generated in 0.0153 seconds

About Us ·  Contact Us ·  Samples ·  Solutions ·  Legal Terms and Conditions ·  Privacy Policy

©2008 SolutionLibrary.com

Search for Solutions About Us Samples