Question
CSCI 161 - Lab 3: Looper Objectives The objectives of this assignment are to reinforce and help teach: proper Java program class construction, purpose of
CSCI 161 - Lab 3: "Looper"
Objectives
The objectives of this assignment are to reinforce and help teach:
proper Java program class construction, purpose of the main method and use of other methods that each perform a smaller part of the overall problem
use of variables
use of methods for commonly repeated tasks
use of conditional statements (if/else)
use of for loops
use of Scanner class for integer input
Overview
For this lab you will develop a program that will prompt the user for two different integer values and then display all the numbers between the first entered integer and the second entered integer, inclusively.
For example, if the user first enters 5 and then enters 12, the program will output the numbers: 5, 6, 7, ..., 11, 12
Take care for whether or not the first number entered by the user is less than or greater than the second number. For example, if the first number entered is 15 and the second numbered entered is 7, then the program should output the numbers: 15, 14, 13, ..., 8, 7. The order is important.
Your output should look just like the output format below, with each returned integer from your loop on its own line.
Instructions
Following are the instructions and you should follow them carefully:
Using Eclipse create a new Java Project and name it: Lab3
As with all your labs, add a class of the same name, Lab3, and include in that class a main method.
Your program should be properly commented.
Your program should use methods where appropriate. For example, your program needs to prompt for and get two different integer values; one it refers to as "first" and the other as "second". A proper method might be one that accepts as input the Scanner object and a string variable as to which integer is being requested. In that way, the method constructs the prompt text and prompts the user for the integer, reads it via the Scanner object, and returns it as an integer return.
Your program should only output one (1) line of output if the first and second integers entered by the user are the same.
Your program should output according to the "Output Format" below.
When the lab is complete and working submit it as Lab3
Output Format
Following is the desired output format:
Please enter the first integer: 15 Please enter the second integer: 7 Output: 15 14 13 12 11 10 9 8 7
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started