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

  Employee type and the number of hours

Write a program that calculates the salary for the employee. The hourly rate for permanent staff (P) is 200, contract staff (C) is 150 and temporary staff (T) is 100. The program accepts the employee type and the number of hours the employee work.

  Debug a program with a jframe

Design, implement, test, and debug a program with a JFrame that allows the user to enter a series of contacts' names, ages, e-mail addresses, and cell phone numbers, and creates a file from the entered data

  What is method overloading

1. What is method overloading? 2. What is the purpose of a constructor? 3. How do you call a method of one class from a method of another class?

  Addressed with attributable risk

Which of the following questions is addressed with attributable risk?

  Discuss the necessity of designing programs to handle except

Discuss the necessity of designing programs to handle exceptions of various types

  How to compile and debug your work

You will be writing a Java program to allow people to play the 24-puzzle (the obvious variant where the frame is 5x5) puzzle) in a text based context. My goal is that you recall how to enter programs (probably using jGrasp), how to write a small/s..

  Develop a graphical user interface based java program

Develop a Java program that can communicate with a real SMTP email server for sending emails. TNE 60003 - introduction to network programming, You program should provide a GUI and can successfully send the SMTP commands to the mail server

  Create an abstract employee class

We are going to create an abstract Employee class and an abstract calculatePay method. The abstract Employee class will prevent a programmer from creating an object based on Employee

  Create an interface that includes a group box

Create an interface that includes a group box that contains 3 check box and 3 text box, the three text boxes should be invisible when the application starts

  Java''s type int has limit onhow large aninteger it can store

Java's type int has a limit on how large an integer it can store. This limit can be circumvented by representing an integer as an array of digits. Write an interactive program that adds two integers of up to 50 digits each.

  Write following java expressions in mathematical notation

Write the following Java expressions in mathematical notation.

  Implement a generic class set

Implement a generic class Set that maintains a set of items of generic type T using the class LinkedList in the Java API. Your Set class must provide the subsequent functionality:

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