Create a Java program that will accept, validate, potentially repeatedly prompt the user for a valid integer input, and produce an output in the console based on explicit specifications. This program can be broken down grossly into three major components: 1. Variable declaration/initialization. 2. User input: you are to retrieve a single integer input (userInt) from a user. If userInt is less than 546, or userInt is greater than 1000, or userInt is not a multiple of 3, your program must prompt the user for a new integer input. Any new input must not trigger any of the aforementioned conditions before your program produces an output. 3. Output: Once a valid userInt is accepted: a)Print only once“Output:” to the console. b) Replicate exactly the column-like designs shown in the examples below. To achieve this, 111 is subtracted from userInt after each loop iteration and displays exactly 5 lines after “Output:”.
Create a Java program that will accept, validate, potentially repeatedly prompt the user for a valid integer input, and produce an output in the console based on explicit specifications. This program can be broken down grossly into three major components: 1. Variable declaration/initialization. 2. User input: you are to retrieve a single integer input (userInt) from a user. If userInt is less than 546, or userInt is greater than 1000, or userInt is not a multiple of 3, your program must prompt the user for a new integer input. Any new input must not trigger any of the aforementioned conditions before your program produces an output. 3. Output: Once a valid userInt is accepted: a)Print only once“Output:” to the console. b) Replicate exactly the column-like designs shown in the examples below. To achieve this, 111 is subtracted from userInt after each loop iteration and displays exactly 5 lines after “Output:”.
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
Create a Java program that will accept, validate, potentially repeatedly prompt the user for a valid integer
input, and produce an output in the console based on explicit specifications. This program can be broken down grossly into
three major components:
1. Variable declaration/initialization.
2. User input: you are to retrieve a single integer input (userInt) from a user. If userInt is less than 546, or userInt is
greater than 1000, or userInt is not a multiple of 3, your program must prompt the user for a new integer input. Any
new input must not trigger any of the aforementioned conditions before your program produces an output.
3. Output: Once a valid userInt is accepted:
a)Print only once“Output:” to the console.
b) Replicate exactly the column-like designs shown in the examples below. To achieve this, 111 is subtracted from
userInt after each loop iteration and displays exactly 5 lines after “Output:”.
COMP 248
Lab Exercise 4.3-Section_E_F
Winter 2018
Due date:Today, at the end of the lab period.
Kind Reminder:
Read this entire document before beginning your lab.
Make sure to locate and place the PC2 Lab System on your desktop. The C248LabInstructionForStudents file is available on
the H: drive if you don’t remember how to use the system, you should worry about this after completing the question.
For this lab you are required to fulfill all requirements exactly as described in this provided document, no less, no more.
Column Print
Today you are to create a program that will accept, validate, potentially repeatedly prompt the user for a valid integer
input, and produce an output in the console based on explicit specifications. This program can be broken down grossly into
three major components:
1. Variable declaration/initialization.
2. User input: you are to retrieve a single integer input (userInt) from a user. If userInt is less than 546, or userInt is
greater than 1000, or userInt is not a multiple of 3, your program must prompt the user for a new integer input. Any
new input must not trigger any of the aforementioned conditions before your program produces an output.
3. Output: Once a valid userInt is accepted:
a)Print only once“Output:” to the console.
b) Replicate exactly the column-like designs shown in the examples below. To achieve this, 111 is subtracted from
userInt after each loop iteration and displays exactly 5 lines after “Output:”.
Based on the previous specifications your program should look and behave exactly as displayed in the cases below:
Note 1: You are to expect a perfect user who will always enter integer values.
Note 2: This problem can be done with one or two loops.
Note 3: All calculations, inputs and outputs should be in integer format and the use of libraries other than
java.util.Scanner is prohibited.
Note 4: Final thought, remember that your solution is case-sensitive, space-sensitive, and fulfill the above instructions
carefully and precisely.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.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