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
madam [21]
3 years ago
15

Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl

ace)?
What expression produces the third-to-last digit of the number (the 100s place)?
(Note: Our code checker won't match every possible expression; please come up with the simplest expression using division and modulus.)
10s place
100s place
Computers and Technology
1 answer:
kobusy [5.1K]3 years ago
4 0

Answer:

int second_to_last = (number/10)%10;

int third_to_last = (number/100)%10;

Explanation:

The first expression int second_to_last = (number/10)%10; first divide the number by ten and then get modulus by dividing by ten again which will then give the second to last digit.

Assuming number is 146 the second to last digit will be 4.

for the second expression int third_to_last = (number/100)%10; first divide the number by hundred and then get modulus by dividing by ten which will then give the third to last digit.

Assuming number is 4368 the third to last digit will be 3.

You might be interested in
Each web site contains a(n) ____ page, which is the first document users see when they access the site.
katrin2010 [14]
Home is the answer. Hope this helps. :)
7 0
3 years ago
Which of the following statements concerning a short in a series circuit is true?
Romashka [77]

Answer:

what is the answers it gave you?

6 0
3 years ago
What Security Issu E Commerce ?​
Andre45 [30]

Answer:

e means we don't know so I can't tell the answer

5 0
2 years ago
What is the fifth and final stage in the process of media production
Mama L [17]

edit is the 5th and distribute is the final stage in process of media production


6 0
3 years ago
Write a C function (NOT A COMPLETE PROGRAM) which uses the RETURNstatement to calculate and return the total cost for purchasing
stira [4]

Answer:

int calculate_cost(int quantity) {

   double cost = 0;

   if (quantity <= 20)

       cost = quantity * 23.45;

   else if (quantity >= 21 && quantity <= 100)

       cost = quantity * 21.11;

   else if (quantity > 100)

       cost = quantity * 18.75;

   

   return cost;

}

Explanation:

Create a function called calculate_cost that takes one parameter, quantity

Initialize the cost as 0

Check the quantity using if else structure. Depending on the quantity passed, calculate the cost. For example, if the quantity is 10, the cost will be $234.5

Return the cost

3 0
3 years ago
Other questions:
  • What should you use as the argument for the goto() command?
    6·1 answer
  • What is the multiplier effect, and how can you prevent if from happening?
    13·1 answer
  • What tool do you use to secure remote access by users who utilize the internet??
    7·1 answer
  • How much health did a supply drop balloon originally have??
    7·2 answers
  • Robert works in a call center and receives a call from Kathy. Kathy says she can no longer access the online reporting applicati
    13·1 answer
  • Hypercompetition implies that any architecture must be designed with maximum flexibility and _____ to ensure it can handle the i
    6·1 answer
  • I had tried to turn on Linux on the Chromebook but it's not working
    11·2 answers
  • Can find error , suppose to print what season it is and if fails : Traceback (most recent call last):
    11·1 answer
  • What are the specifications of mine shaft head gear​
    11·2 answers
  • In high-tech fields, industry standards rarely change.<br> True <br> False
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!