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
Alvin has created a non-extensive site map of all the commonly visited pages of his website. What is such a site map called?
gregori [183]

Answer:

<u>А. XML site map</u>

Explanation:

Indeed, the XML site map is the modern term used to describe a non-extensive site map containing details such as the commonly visited pages of a website.

Alvin's <u>XML site map would allow search engines to have a  record of commonly visited pages of his website.</u>

8 0
2 years ago
Project stem test 3 answers
ASHA 777 [7]

Answer:

I gave you the answers

Explanation:

3 0
3 years ago
Which of the following are common problems experienced with software applications?
dimulka [17.4K]
1. Incorrect Calculations 2. Incorrect data edits 3. Ineffective data edits 4. Incorrect coding/implementation of business rules 5. Inadequate software performance 6. Confusing or misleading data 7. Software that is difficult to use 8. Obsolete software 9. Inconsistent processing 10. Difficult to maintain and understand 11. Inadequate security controls
6 0
3 years ago
Write a function decimalToBinaryRecursive that converts a decimal value to binary using recursion. This function takes a single
Delicious77 [7]

Answer:

Check the explanation

Explanation:

#include <iostream>

#include <string>

using namespace std;

string decimalToBinaryRecursive(int n) {

   if(n == 0) {

       return "0";

   } else if(n == 1) {

       return "1";

   } else {

       int d = n % 2;

       string s;

       if (d == 0) {

           s = "0";

       } else {

           s = "1";

       }

       return decimalToBinaryRecursive(n/2) + s;

   }

}

int main() {

   cout << decimalToBinaryRecursive(0) << endl;

   cout << decimalToBinaryRecursive(1) << endl;

   cout << decimalToBinaryRecursive(8) << endl;

   return 0;

}

See the output image below

5 0
3 years ago
Type the correct answer in the box. Spell the word correctly. A company has its branches spread over five places in a state. It
NISA [10]

Answer:

saving

Explanation:

5 0
3 years ago
Other questions:
  • Help me Please?!! I will put you as brainliest.<br>I hope I spelled that right.
    5·2 answers
  • Consider sorting n numbers stored in array A by first finding the smallest element of A and exchanging it with the element in A[
    13·1 answer
  • Assume that input file references a Scanner object that was used to open a file. Which of the following while loops shows the co
    6·1 answer
  • You wrote a C application that takes 20 seconds using your desktop processor. An improved C compiler is released that requires o
    6·1 answer
  • Does anyone know a way to skip the videos on Edgnuity?
    15·1 answer
  • Write a Java program that prompts the user for an int n. You can assume that 1 ≤ n ≤ 9. Your program should use embedded for loo
    5·1 answer
  • Complete the statement below using the correct term.<br>Website managers use<br>every day​
    11·2 answers
  • What is a cloud in the world of computing
    7·1 answer
  • Logan has developed an excellent presentation with interesting content. He received great feedback on the evaluation
    10·1 answer
  • 1. (A) What do you mean by computer? Discuss the use of<br> computer in daily life.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!