1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
statuscvo [17]
3 years ago
14

Write a program using integers userNum and x as input, and output userNum divided by x four times. Ex: If the input is 2000 2, t

he output is: 1000 500 250 125 Note: In Coral, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discarded).
Computers and Technology
1 answer:
BaLLatris [955]3 years ago
5 0

Answer:

import java.util.Scanner;

public class Division {

   public static void main(String[] args) {

    Scanner in = new Scanner(System.in);

       System.out.println("Enter an integer");

       int userNum = in.nextInt();

       System.out.println("Enter the divisor");

       int x = in.nextInt();

           int first = userNum/x;

           int second = first/x;

           int third = second/x;

           int fourth = third/x;

       System.out.println(first+" "+second+" "+third+" "+fourth);

   }

}

Explanation:

  • In Java programming langauge use the scanner class to receive the values from the user (userNum and x)
  • Carryout integer division of userNum/x to obtain the first number
  • Repeat the sam step to obtain the second, third and fourth number
  • Output the numbers to the user
You might be interested in
(BRAINLIEST FOR FIRST CORRECT ANSWER) Mark (all) the statements that best describe the use of spreadsheets and tables in present
mel-nik [20]

the answer is Headers should be descriptive of the cell content, The font size should be at least 18-point. hope this helps!!!

5 0
3 years ago
When you go to your school's computer support office, it will help if you have written down any _________ messages.
Finger [1]

Answer:

error

Explanation:

3 0
2 years ago
What is payload?
Elina [12.6K]

Answer:

a block of data inside the paket

4 0
3 years ago
The cost of a CLEP exam is about__<br><br> A$100 <br> B $50 <br> C$80<br> D$170
Elanso [62]

Your answer is C or $80

When averaging the costs of credit hours at public and private community colleges and four-year institutions, the median cost for a three-hour class in 2017 was $1,782. Conversely, each CLEP exam costs $85.

5 0
3 years ago
Read 2 more answers
What is a method that invokes itself called?
Anna11 [10]

Answer:

D. recursive method

Explanation:

I took the test on PLATO

6 0
2 years ago
Other questions:
  • When data are entered into a form and saved, they are placed in the underlying database as knowledge?
    10·1 answer
  • Can anyone find any words in here?
    14·2 answers
  • A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large compu
    10·1 answer
  • In cryptography, the term "Secret algorithm" refers to an algorithm designed in a way that prevents the examination of its inner
    12·2 answers
  • How do graphic designers showcase their work?
    14·2 answers
  • A TCP Sender is just about to send a segment of size 100 bytes with sequence number 1234 and ack number 436 in the TCP header. W
    5·1 answer
  • Which descriptions offer examples of Correction Services workers? Select all that apply.
    8·1 answer
  • Who innovated an aeroplane? ​
    5·1 answer
  • Which is the least technically experienced technical support group?
    7·1 answer
  • Wendell notices that the company's top executives share a belief that managers are directly responsible for the organization's s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!