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
After this week im gonna be moderator who ever needs help let me know
Sav [38]

Answer:

ok

Explanation:

thanks, for offering help through here. Have a nice day.

4 0
3 years ago
Create a program to deteate a program to determine whether a user-specified altitude [meters] is in the troposphere, lower strat
nordsb [41]

Answer:

#include <iostream>

using namespace std;

int main()

{

   float altitude;

   cout<<"Enter alttitude in meter";

cin >>altitude;

if(altitude<0 || altitude > 50000)

{

   cout<<"Invalid value entered";

   return 0;

}

else{

   if(altitude<= 10000)

   {cout <<"In troposphere "<<endl;}

   

   else if(altitude>10000 && altitude<=30000)

   {cout <<"In lower stratosphere"<<endl;}

   

   else if(altitude>30000 && altitude<=50000)

   {cout <<"In upper stratosphere"<<endl;}

   

}

   return 0;

}

Explanation:

Define a float type variable. Ask user to enter altitude in meters. Store value to altitude variable.

Now check if value entered is positive and less than 5000,if its not in the range of 0-50,000 display a termination message and exit else check if it's in less than 10000, in between 10000 and 30000 or in between 30000 and 50000.

10,000 is above sea level is troposphere.

10,000-30,000 is lower stratosphere.

30,000-50,000 is upper stratosphere.

3 0
3 years ago
Brainless is one the way if you help
V125BC [204]

Answer:

1. x - 6

2. p - ? = 7

i chose these equations because

a number - 6 = the weight of your backpack.

p - an unknown number without a substitute variable = slices of bread left.

3 0
2 years ago
Develetech has a security policy that mandates a basic security feature for mobile device access. What is this basic security fe
kirill [66]

Answer:A password or a PIN

Explanation: Develetech is a industry that has the a internet page and can also be used in the mobile devices. There is particular authorization that the organization provides to an individual user for accessing of the services to maintain the security .The security is maintained by providing the devices with an encrypted text that is known as the password. The user has to enter the pin or password to execute the service on device.

5 0
3 years ago
Which of the following can you do under the fair use exceptions?
anzhelika [568]
What fair use exceptions are you talking about? There are thousands on fair use exceptions.
8 0
3 years ago
Other questions:
  • In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends deci
    7·2 answers
  • Trish uas bought a new computer, which she plans to start working on aftwr a week. Since Trish has not used computers in the pas
    13·1 answer
  • Blurring in a photograph can be due to _____ or ______.
    14·2 answers
  • You are holding a rock tied to a string, which is an example of a pendulum. identify and explain the proper term for each part o
    10·2 answers
  • Which science topics would be suited for this organizational aid? Check all that apply.
    11·1 answer
  • Which item is used for formatting in responsive web design?
    14·2 answers
  • What special signal is issued periodically from an Access Point and contains the network transmission rate and service set ident
    7·1 answer
  • What is bespoke software???​
    9·2 answers
  • If you do a Find and Replace for a term, where will Word begin looking for the term?
    6·1 answer
  • You find information that you know to be classified on the internet. What should you do.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!