Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what did I do wrong? 2.20 LAB: Divide input integers Write a program using integers userNum and divNum as input, and output userNum divided by

what did I do wrong?
image text in transcribed
image text in transcribed
image text in transcribed
2.20 LAB: Divide input integers 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: 20002 the output is: 1000500250 Note in Java, integer division discards fractions. Ex 6/4 is 1 (the 0.5 is discarded). 2.201.1 AB: Divide input integers import java. utzL.scanner; public class LabProgram \{ public static void main(String[ args) \{ int numNominator; int numDenominator; int numsum; numNominator =2000; numbenominator =2; numSum = numNominatorumbenominator; System.out.print(numSum); numSum = numSum/ numdenominator; System, out.print(" "); System.out.print(numSum); numsum = numSumumbenominator; System,out.print(" "); Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Enter program input (optional) Enter program input (optional) 20002 Run program Input(fromabove)LabProgram.java(Yourgcogran)Output(shownbelow) Program output displayed here 1000500250

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions