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
Vesna [10]
3 years ago
9

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)?
Computers and Technology
1 answer:
Jobisdone [24]3 years ago
8 0
Private int number = 123;
// using this number "123"

int hundred = (number % 10); // gets third to last
number /= 10;
int tenth = (number % 10); // gets second to last
number/=10;
int ones = (number % 10); // first digit

 
You might be interested in
Implement a recursive method named power that takes 2 integer parameters named base and expo. The method will return the base ra
nika2105 [10]

Answer:

def power(base, expo):

   if expo == 0:

       return 1

   else:

       return base * power(base, expo-1)

Explanation:

*The code is in Python.

Create a method called power that takes base and expo as parameters

Check if the expo is equal to 0. If it is return 1 (This is our base case for the method, where it stops. This way our method will call itself "expo" times). If expo is not 0, return base * power(base, expo-1). (Call the method itself, decrease the expo by 1 in each call and multiply the base)

3 0
2 years ago
-Define three types of user mode to kernel mode transfers?
Ivahew [28]

Answer:

 The three types of user mode to the kernel mode transferred occurred due to the:

  • It is mainly occurred due to the interrupt when, it send to the central processing unit (CPU).
  • It also occurs due to the hardware exception and when the memory is access illegally as it is divided by the zero.
  • It is mainly implemented or executed by the trap instruction as the system are basically executed by the program.
7 0
2 years ago
What describes a group of cells?<br> O crowd<br> Orange<br> O set<br> gangle
deff fn [24]

Answer:

A crowd because it makes more sense tho i could be wrong

7 0
2 years ago
Read 2 more answers
Write a method called classAttendence() that creates a 10-by-10 two-dimensional array and asks for user input to populate it wit
gladu [14]

Answer:

The method written in Java is as follows:

public static void classAttendance(){

   Scanner input = new Scanner(System.in);

   String[][] names = new String[10][10];

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

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

       System.out.print("Student Name: "+(i+1)+" , "+(j+1)+": ");

       names[i][j] = input.nextLine();        

    }  

   }

}

Explanation:

This defines the classAttendance() method

public static void classAttendance(){

   Scanner input = new Scanner(System.in);

This declares the 2D array of 10 by 10 dimension as string

   String[][] names = new String[10][10];

This iterates through the rows of the array

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

This iterates through the columns of the array

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

This prompts user for student name

       System.out.print("Student Name: "+(i+1)+" , "+(j+1)+": ");

This gets the student name from the user

       names[i][j] = input.nextLine();        

    }  

   }

The method ends here

}

<em>See attachment for complete program that include main method</em>

Download txt
6 0
2 years ago
Queues can be represented using linear arrays and have the variable REAR that point to the position from where insertions can be
Levart [38]

Answer:

8

Explanation:

7 0
2 years ago
Other questions:
  • The four functions of a computer are
    5·1 answer
  • What would happen if a pc that contains a power supply that does not automatically adjust for input voltage is set to 230 volts
    13·1 answer
  • Which of the following is not a type of user account? A. Administrator b. Guest c. Group d. Standard
    10·1 answer
  • According to the Computing Research Association, the number of undergraduate degrees awarded in computer science at doctoral-gra
    11·1 answer
  • Applications require you to provide the following basic elements: social security number, experience, and favorite memories. Tru
    11·1 answer
  • Which element appears within the top margin of the document but does not form the part of the body of the text?
    15·1 answer
  • If you want to present slides to fellow students your coworkers which productivity software should you use to create them
    15·2 answers
  • Detecta 1 problema
    5·2 answers
  • I want to get an output picture in python but it says this. I'm using turtle
    12·1 answer
  • Which influence on spending deals with the motivation to<br> purchase a product?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!