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

  Implements the measurable interface

Implement a class Quiz that implements the Measurable interface. A quiz has a score and a letter grade (such as B+).

  Design an abstract data type in java

Design an abstract data type in Java that represents a musical pitch

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  In cryptarithmetic puzzles mathematical equations are

in cryptarithmetic puzzles mathematical equations are written by using letters. each letter can be digit from 0 to 9

  Write a program that plots a bar chart for comparing mtbfs

Write a program that plots a bar chart for comparing the MTBFs of different elevator models. The data to be displayed is prepared in a file: Each line consists of the model's letter and the MTBF that has been measured for that file.

  Discuss the use of java as a web-based application tool

Discuss the use of Java as a Web-based application tool and as a cross-platform programming language. Provide some example benefits and a general discussion of how the cross platform technology works.

  Complier error and run time error

Q1. What do you understand by complier error and run time error? Explain by example.

  Write a program that evaluates the day of the week for new

write a program that evaluates the day of the week for new years day in the year 3000. to do this you must create your

  Implement bounded partial queue using signaling mechanism

Can you explain the reason? You can run the experiments on ecen5033.colorado.edu. Submit the code as well as experimental results - Implement both these schemes in Java. Each of the methods foo() and bar() just sleeps for 20 milliseconds.

  Java programming-days alive calculator

The context for this assignment (all parts) is a ‘Days Alive Calculator' - a small desktop applicationfor calculating the number of days someone has been alive based on the date of birth and a seconddate, which may be today's date or some other date.

  Write an application that uses an array

Write an application that uses an Array to store 10 messages of type String. You can load this data structure with 10 messages of your choosing.

  Write a class called rationalnumber

Write a class called RationalNumber that represents a fraction with an integer numerator and denominator.

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