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
A computer would do a better job than a human at solving lengthy, complex math problems. True False
Alborosie

Answer:

I would say true

Explanation:

Humans, by contrast, can master many things, from tying our shoes to cooking an omelet to solving complex math equations. The best AI hardly comes close to the incredible creativity and design of any human, and it’s an open question whether AI can ever become what its prophets claim. Second, when we make AI, we are basically copying our Creator.

8 0
2 years ago
Read 2 more answers
EASY In the image, what will be the result of pressing the Delete key
kaheart [24]
D would be the answer
7 0
3 years ago
Read 2 more answers
The decryption broker feature is supported by which three Palo Alto networks firewall series
dalvyx [7]

Answer:

See the explanation section

Explanation:

Decryption broker features is supported for the following:

PA-7000 Series devices

PA-5200 Series devices

PA-3200 Series devices

The model supported by the decryption broker features include:

VM-300 model

VM-500 model

VM-700 models.

They usually requires SSL Forward Proxy decryption to be enabled, where the firewall is established as a trusted third party to session traffic.

3 0
2 years ago
Which document lists the planned dates for performing tasks and meeting goals identified in the project plan?
Mnenie [13.5K]
<span>The document is called as Project schedule. this document contains the tasks that needs to be performed, the time that is given to the perform the task, the target dates. It also contains the budget of the project and the budget can be represented task wise. This helps in performing the project in a more organized way.</span>
5 0
2 years ago
In this lab, you create a programmer-defined class and then use it in a C++ program. The program should create two Rectangle obj
MakcuM [25]

The program based on the information given is illustrated below.

<h3>What is a program?</h3>

A computer program simply means a sequence of instructions in a programming language that is created for a computer to execute.

It should be noted that computer programs are among the component of software.

The program to create two rectangle objects and get their area and perimeter is depicted:

// Rectangle.cpp

using namespace std;

class Rectangle

{

public:

// Declare public methods here

void setLength(double);

void setWidth(double);

double getLength();

double getWidth();

double calculateArea();

double calculatePerimeter();

private:

// Create length and width here

double length, width;

};

void Rectangle::setLength(double len)

{

length = len;

}

void Rectangle::setWidth(double wid)

{

// write setWidth here

width = wid;

}

double Rectangle::getLength()

{

// write getLength here

return length;

}

double Rectangle::getWidth()

{

// write getWidth here

return width;

}

double Rectangle::calculateArea()

{

// write calculateArea here

return length*width;

}

double Rectangle::calculatePerimeter()

{

// write calculatePerimeter here

return 2*(length+width);

}

// This program uses the programmer-defined Rectangle class.

#include "Rectangle.cpp"

#include <iostream>

using namespace std;

int main()

{

Rectangle rectangle1;

Rectangle rectangle2;

rectangle1.setLength(10.0);

rectangle1.setWidth(5.0);

rectangle2.setLength(7.0);

rectangle2.setWidth(3.0);

cout << "Perimeter of rectangle1 is " << rectangle1.calculatePerimeter() << endl;

cout << "Area of rectangle1 is " << rectangle1.calculateArea() << endl;

cout << "Perimeter of rectangle2 is " << rectangle2.calculatePerimeter() << endl;

cout << "Area of rectangle2 is " << rectangle2.calculateArea() << endl;

return 0;

}

/*

output:

The perimeter of rectangle1 is 30

The area of rectangle1 is 50

The Perimeter of rectangle2 is 20

The area of rectangle2 is 21

*/

Learn more about program on:

brainly.com/question/1538272

#SPJ1

8 0
1 year ago
Other questions:
  • 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
  • Marisol manages the online advertising campaigns for a chain of toy stores with both a physical and an online presence. Which Go
    7·1 answer
  • It is generally safe to provide your social security number to
    7·2 answers
  • Object Linking and Embedding (OLE) data integration allows you to
    8·1 answer
  • In order to consolidate your theoretical knowledge into technique and skills with practical and applicational value, you will us
    8·1 answer
  • When you're working with a word processing document and you press the Del key, what happens? A. The paragraph you're working on
    12·1 answer
  • _____ is used to temporarily hold small units of program instructions and data immediately before, during, and after execution b
    10·1 answer
  • Define computers software.dicuss the types of computer software​
    5·1 answer
  • Una laptop agarra mas internet que una computadora de escritorio?
    11·1 answer
  • Say true or false
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!