While loop to count down every odd number from 40 to 0

Assignment Help JAVA Programming
Reference no: EM13942306

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--;
}}}

Reference no: EM13942306

Questions Cloud

What is the mass rate of oxygen lost : If the outer surface is at 280 K and the inner surface is at 95 K, what is the mass rate of oxygen lost due to evaporation?
Ensure the presentation compliments : Can you design a weekly report to be used by all secretaries. Ensure the presentation compliments other report templates and follows the corporate style guidelines. Include a heading at the top which says Environmental Challenges Australia.
What approaches organizations can take to motivate employees : Watch the video titled, "Puzzle of Motivation" (18 min 36 s). You can also view the video at https://www.youtube.com/watch?v=rrkrvAUbU9Y. Next, explain what approaches organizations can take to motivate their employees other than pay incentives
Calculate the average fixed maintenance : Management has asked you to calculate the average fixed maintenance cost per unit at an activity level of 8,200 units in a month. You checked and this new level of activity, like the previous, is within the relevant range.
While loop to count down every odd number from 40 to 0 : 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
Description of grammatical errors you found : Your opinion on how the errors reflect on the company, author, or editor. How do you personally feel about the company given the grammar error involved?
What are the current yield and yield to maturity : A bond has the following terms: Annual interest 100 , Term 15 Years, Principal $1000 a. What is the current price of the bond if comparable yields are 7 percent? b. What are the current yield and yield to maturity given the price of the bond in the p..
Complete in preparation for this critical thinking : This week you have an excellent opportunity to apply the concepts and frameworks described in this module to a real-world situation. First, identify an organization that you know well. For example, it could be your place of work, your church, or a..
Culture and definition of the company framework : A description of the organisation culture and a definition of the company framework and its objectives.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd