Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q: Write a program using integers userNum and divNum as input, and output userNum divided by divNum three times. Note: End with a newline. Ex:

Q: Write a program using integers userNum and divNum as input, and output userNum divided by divNum three times. Note: End with a newline.

Ex: If the input is: 2000 2 and the output is 1000 500 250

Note: In Java, integer division discards fractions. Ex: 6/4 is 1 (the 0.5 is discarded).

Java Submission :

import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner s = new Scanner(System.in); int userNum = s.nextInt(); int divNum = s.nextInt(); int i = 0; while(i

Error - Output is nearly correct, but whitespace differs. See highlights below.

image text in transcribed

I am going in circles trying to figure out the whitespace they are referring to. Thank you in advance for your assistance.

Your output Expected output

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 Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions