Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code in Java. Staggered Print Today you are to create a program that will accept, validate, potentially repeatedly prom pt the user for a

Please code in Java.

image text in transcribed
Staggered Print Today you are to create a program that will accept, validate, potentially repeatedly prom pt 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 ingut: you are to retrieve a single integer input (userlnt) from a user. If userl'nt is less or equal to -999, or usen'nt is greater than -84, or userint is not a multiple of 4, 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 usen'nt is accepted: a) Print only once \"Output\" to the console. b) Replicate exactly the staggered-like designs shown in the examples below. To achieve this, usen'nt is divided by -3 after each loop iteration and diSpIays exactly 5 lines after "Output\". Based on the previous specications your program should look and behave exactly as displayed in the cases below: E"*""."".i"t' "999 . Enter 0" int: '93 Enter an int: 98@ I'w''d "'t' "'3' "9m": Invalid int, try again: -1@2 Invalid int, try again: 134 Invalid int, try again: Invalid int, try again: Invalid int, try again: Output: Output: -104 34 -11 3 -1 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

What behaviors do effective leaders exhibit?

Answered: 1 week ago

Question

What is privatization?

Answered: 1 week ago

Question

What is wastage?

Answered: 1 week ago

Question

Environmental education explain?

Answered: 1 week ago

Question

Scope of environmental science short brief ?

Answered: 1 week ago