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
r-ruslan [8.4K]
3 years ago
14

The input to the following algorithm is a positive integer. The goal is to find the digit in the hundreds place of the integer.

(For example, if we input 28398, we want the algorithm to output 3.)
Below is the proposed algorithm, but the values of X and Y are missing:

Step 1: Divide the input by X. Call the quotient and ignore the remainder.

Step 2: Now divide by Y. Ignore the quotient and call the remainder

Step 3: Return

What X, Y will allow this algorithm to correctly find the hundreds digit of the input? Put X in the first blank and Y in the second blank.

Note: We would say that has a quotient of 2 and a remainder of 1.
Computers and Technology
2 answers:
Serggg [28]3 years ago
4 0
The first division should reduce the hundreds digit to the units digit by dividing by 100.  Ignoring remainder means ignoring the previous units and tens digits.
The second division, where we keep the remainder is to extract the units digit by ignoring the quotient.  So we divide by 10.  The discarded digits are the tens and higher digits.

max2010maxim [7]3 years ago
3 0

Answer:

X = 100 and Y = 10

Explanation:

Let's do the example, where input = 28398

Step 1: Divide the input by 100. Call the quotient and ignore the remainder.

28398/100 = 283.98, quotient = 283, remainder = 89

Step 2: Now divide by 10. Ignore the quotient and call the remainder  

283/10 = 28.3,  quotient = 28, remainder = 3

Step 3: Return 3

You might be interested in
Every call to a recursive function has its own code and its own set of ____ and local variables
777dan777 [17]

Answer: Parameters

Explanation:

Whenever a call to a recursive function is made, then the function has its own code and its own set of parameters with local variables. These parameters are within the scope of the recursive function. For example while finding the factorial of a number we are given the function with parameter such as int recursive(int n) where int n is a parameter passed into the function.

8 0
3 years ago
Which command will display each line in the text file based on the alphabet?
SSSSS [86.1K]
On windows, it is the type command.
On linux, the cat command outputs the file.
All bytes that represent printable characters will be displayed as ASCII or even Unicode.
6 0
3 years ago
What is the command to disable any Processes in linix??
stiks02 [169]

Answer: killall[process_name]  or kill[PID]

Explanation:

Killall is a tool for disabling running processes on the system. It will disable all programs that matches the name mentioned.

kill disables processes based on process id numbers. it does not disable the process directly. The process recieves a signal where the process will follow instructions which it has to follow if it receives the signal.

7 0
2 years ago
ANYONE WANNA FRIEND ME ON DISCORD ゴRose joestarゴ#2088
Sergeeva-Olga [200]

JOJO fan!?!!?!??!?!?!!?!?

6 0
3 years ago
What is the definition of "potential energy"?
muminat
Well potential energy is energy that is in a object while its not moving so i would go your third option 
4 0
3 years ago
Read 2 more answers
Other questions:
  • What is the input output ratio if its 12/23
    7·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • Should organizations fear websites where consumers post negative messages about products or services? What actions can companies
    12·1 answer
  • Given the following output from /etc/fstab, which filesystems will be automatically checked on boot by the fsck command? [BEGIN
    5·1 answer
  • Thomas came into work this morning and turned on his computer and nothing happened. He immediately called the help desk, and you
    5·1 answer
  • What will be the output of the following code? <?php $foo = 'Bob'; $bar = $foo; $bar = "My name is $bar"; print $bar; print $
    8·2 answers
  • write a pay-raise program that requests a person's first name, last name, and current annual salary, and then displays the perso
    6·1 answer
  • What are examples of Table Tools options that can help edit data?
    15·2 answers
  • Which of these are characteristics of a Python data type? Check all that apply.
    11·1 answer
  • Meera has created a small program in Python. She wants to store elements of the same data type in an organized
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!