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
The 10 and 2 o'clock hand position on the steering wheel is no longer recommended because _____.
lesantik [10]
C.

Experts say with more compact steering wheels, the old 10 and 2 puts arms in path of the air bag. Resulting in bodily harm if it deployed.
5 0
3 years ago
How do you delete answers on Brain.ly?
Svetlanka [38]
Need to go to the settings
8 0
3 years ago
Read 2 more answers
Write a void function SelectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The fu
salantis [7]

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

void SelectionSortDescendTrace(int numbers[], int numElems) {

int maxInd;

for (int i = 0; i < numElems - 1; ++i) {

maxInd = i;

for (int j = i; j < numElems; ++j) {

if (numbers[j] > numbers[maxInd]) {

maxInd = j;

}

}

int temp = numbers[i];

numbers[i] = numbers[maxInd];

numbers[maxInd] = temp;

for (int j = 0; j < numElems; j++) {

cout << numbers[j] << " ";

}

cout << endl;

}

}

int main() {

int numbers[10];

int numElements = 0;

for (int i = 0; i < 10; i++) {

cin >> numbers[i];

if (numbers[i] == -1)

break;

++numElements;

}

SelectionSortDescendTrace(numbers, numElements);

return 0;

}

8 0
3 years ago
How do you fix this windows 7 screen​
tensa zangetsu [6.8K]

Try restarting it. If you can’t restart because the screen is frozen maybe just turn it off and back on. If you already tried restarting and it still didn’t fix the problem, just give it some time. The computer will reset itself eventually which should fix the problem.

6 0
3 years ago
You have this code in your program.
earnstyle [38]

The line code will create array is G = array('f',[2.5, 3, 7.4])

<h3>What is meant by array ?</h3>

As opposed to defining distinct variables for each value, arrays are used to hold numerous values in a single variable. Set the data type (such as int) and the array name, followed by square brackets [, to construct an array.

An array is a collection of elements with the same type that are kept in nearby memory  locations and may each be separately referred to using an index to a special identifier. There is no need to declare five distinct variables when declaring an array of five int values (each with its own identifier).

In the C programming language, arrays are a derived data type that may contain primitive data types like int, char, double, float, etc.

To learn more about array refer to :

brainly.com/question/28061186

#SPJ1

6 0
1 year ago
Other questions:
  • Matt wants to build an app that will reach many people all over the world. However, he worries about having to modify apps for a
    14·1 answer
  • In this story, the reader is strongly encouraged to believe that Skidmore is guilty of poisoning his brother Manchester. Explain
    6·1 answer
  • 11.
    11·1 answer
  • Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =
    7·2 answers
  • A user wants to make sure he can quickly restore his computer after a drive failure to the state it was in when Windows and all
    9·1 answer
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • Miguel owns a tile business. He has two employees who work in a small office. One answers phones and schedules appointments. Ano
    11·2 answers
  • I need help with yes lol please and thank you
    15·2 answers
  • The sameNumber method checks to see if the number of words in the phrase, numwords, is the same number of words contained in the
    5·1 answer
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!