Write a Java program that will ask the user for a starting number, ending number, and a decrement number. The program will then count down, from the starting number down to and including the ending number, by the decrement number, displaying each number on a separate line. Also, for each displayed number, the program will say whether the number is even or odd. This program will require the use of the "while" loop as well as an "if/else" statement. Examine the sample outputs carefully in order to structure your code in a logical manner. This program will require the use of the "while" loop as well as the "if/else" statement. Examine the sample outputs carefully in order to structure your code in a logical manner. Remember... pseudo code is your friend. Work on 1 part at a time. Notes: Carefully read and adhere to coding standards – pay particular attention to the use of braces and indentation Choose meaningful identifiers for all variables and constants Use blank lines here and there to separate logical steps in your code Add comments to document your code. Comments are not optional and must be included. Use a one-line comment before each block to describe what you are doing – don't describe the code syntax, but rather the purpose of the code. These comments should effectively describe the steps in your "algorithm." • Spell things carefully, including capitalization, since Java is fussy about that Check your results! Testing your code is IMPORTANT! Here is a sample run of the program: Here is another sample run: What's the start number? What's the start number? 100 What's the end number? What's the end number? What's the number you are decrementing by? What's the number you are decrementing by? 22 The number 5 is odd. The number 4 is even. The number 100 is even. The number 78 is even. The number 3 is odd. The number 56 is even. The number 2 is even. The number 34 is even. The number 1 is odd. The number 12 is even.
Write a Java program that will ask the user for a starting number, ending number, and a decrement number. The program will then count down, from the starting number down to and including the ending number, by the decrement number, displaying each number on a separate line. Also, for each displayed number, the program will say whether the number is even or odd. This program will require the use of the "while" loop as well as an "if/else" statement. Examine the sample outputs carefully in order to structure your code in a logical manner. This program will require the use of the "while" loop as well as the "if/else" statement. Examine the sample outputs carefully in order to structure your code in a logical manner. Remember... pseudo code is your friend. Work on 1 part at a time. Notes: Carefully read and adhere to coding standards – pay particular attention to the use of braces and indentation Choose meaningful identifiers for all variables and constants Use blank lines here and there to separate logical steps in your code Add comments to document your code. Comments are not optional and must be included. Use a one-line comment before each block to describe what you are doing – don't describe the code syntax, but rather the purpose of the code. These comments should effectively describe the steps in your "algorithm." • Spell things carefully, including capitalization, since Java is fussy about that Check your results! Testing your code is IMPORTANT! Here is a sample run of the program: Here is another sample run: What's the start number? What's the start number? 100 What's the end number? What's the end number? What's the number you are decrementing by? What's the number you are decrementing by? 22 The number 5 is odd. The number 4 is even. The number 100 is even. The number 78 is even. The number 3 is odd. The number 56 is even. The number 2 is even. The number 34 is even. The number 1 is odd. The number 12 is even.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education