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
Naya [18.7K]
3 years ago
13

What is stored by a reference variable?What would be the results after the following code was executed? int[] array1 = {10, 20,

30, 40}; int [] array2 = {20, 30, 50, 60}; array1 = array2; array2 = array1;
Computers and Technology
1 answer:
Romashka [77]3 years ago
8 0

Answer:

Both array1 and array2 would be pointing to the array with {20,30,50,60}.

Explanation:

array1 and array2 are references (pointers) to the array.

array1 = array2; only makes the array1 variable point to the same destination as the array2 variable.

The next assignment array2 = array1; therefore doesn't change anything. array2 was already pointing to this location.

You might be interested in
True or false?
sashaice [31]
True cars are fast and go fast
6 0
3 years ago
Read 2 more answers
Which of the following is true about the Purpose of the Page and the Page Quality (PQ) rating? Select all that apply. True False
aleksandr82 [10.1K]

Answer:

Explanation:

Harmful or malicious pages should always get a page quality (PQ) rating of Lowest. True

Pages with an informational or educational purpose should always be given higher page quality (PQ) ratings than entertainment or gossip pages. False

There is no relationship between the purpose of the page and the page quality (PQ) rating. False

If you cannot determine the purpose of the page after extensive effort, the page quality (PQ) rating should be Lowest. True

7 0
3 years ago
write a mips program that runs on SPIM that allows the user to enter the number of hours, minutes and seconds and then prints ou
adell [148]

Answer:

The mips program will be as:

.MODEL SMALL

.STACK 100H

.DATA

  PROMPT_1  DB  \'Enter the time in seconds up to 65535 = $\'

  PROMPT_2  DB  0DH,0AH,\'The time in hh:mm:ss format is = $\'

  SEPARATOR DB  \' : $\'

.CODE

  MAIN PROC

    MOV AX, @DATA                ; initialize DS

    MOV DS, AX

    LEA DX, PROMPT_1             ; load and display the string PROMPT_1

    MOV AH, 9

    INT 21H

    CALL INDEC                   ; call the procedure INDEC

    PUSH AX                      ; puah AX onto the STACK

    LEA DX, PROMPT_2             ; load and display the string PROMPT_2

    MOV AH, 9

    INT 21H

    POP AX                       ; pop a value from STACK into AX

    XOR DX, DX                   ; clear DX

    MOV CX, 3600                 ; set CX=3600

    DIV CX                       ; set AX=DX:AX\\CX , DX=DX:AX%CX

    CMP AX, 10                   ; compare AX with 10

    JGE @HOURS                   ; jump to label @HOURS if AX>=10

    PUSH AX                      ; push AX onto the STACK

    MOV AX, 0                    ; set AX=0

    CALL OUTDEC                  ; call the procedure OUTDEC

    POP AX                       ; pop a value from STACK into AX

    @HOURS:                      ; jump label

    CALL OUTDEC                  ; call the procedure OUTDEC

    MOV AX, DX                   ; set AX=DX

    PUSH AX                      ; push AX onto the STACK

    LEA DX, SEPARATOR            ; load and display the string SEPARATOR

    MOV AH, 9

    INT 21H

    POP AX                       ; pop a value from STACK into AX

    XOR DX, DX                   ; clear DX

    MOV CX, 60                   ; set CX=60

    DIV CX                       ; set AX=DX:AX\\CX , DX=DX:AX%CX

    CMP AX, 10                   ; compare AX with 10

    JGE @MINUTES                 ; jump to label @MINUTES if AX>=10

    PUSH AX                      ; push AX onto the STACK

    MOV AX, 0                    ; set AX=0

    CALL OUTDEC                  ; call the procedure OUTDEC

    POP AX                       ; pop a value from STACK into AX

    @MINUTES:                    ; jump label

    CALL OUTDEC                  ; call the procedure OUTDEC

    MOV BX, DX                   ; set BX=DX

    LEA DX, SEPARATOR            ; load and display the string SEPARATOR

    MOV AH, 9

    INT 21H

    MOV AX, BX                   ; set AX=BX

    CMP AX, 10                   ; compare AX with 10  

    JGE @SECONDS                 ; jump to label @SECONDS if AX>=10

    PUSH AX                      ; push AX onto the STACK  

   MOV AX, 0                    ; set AX=0

    CALL OUTDEC                  ; call the procedure OUTDEC

    POP AX                       ; pop a value from STACK into AX

    @SECONDS:                    ; jump label

    CALL OUTDEC                  ; call the procedure OUTDEC

   MOV AH, 4CH                  ; return control to DOS

    INT 21H

  MAIN ENDP

7 0
3 years ago
Create an array of doubles with 5 elements. In the array prompt the user to enter 5 temperature values (in degree Fahrenheit). D
dalvyx [7]

Answer:

The solution code is written in Java.

  1. import java.util.Scanner;
  2. public class Main {
  3.    public static void main(String[] args) {
  4.        double myArray [] = new double[5];
  5.        Scanner reader = new Scanner(System.in);
  6.        for(int i=0; i < myArray.length; i++){
  7.            System.out.print("Enter temperature (Fahrenheit): ");
  8.            myArray[i] = reader.nextDouble();
  9.        }
  10.        convert2Cels(myArray, 5);
  11.        for(int j = 0; j < myArray.length; j++){
  12.            System.out.format("%.2f \n", myArray[j]);
  13.        }
  14.    }
  15.    public static void convert2Cels(double [] tempArray, int n){
  16.        for(int i = 0; i < n; i++){
  17.            tempArray[i] = (tempArray[i] - 32) * 5 / 9;
  18.        }
  19.    }
  20. }

Explanation:

Firstly, let's create a double-type array with 5 elements, <em>myArray </em>(Line 6).

Next, we create a Java Scanner object to read user input for the temperature (8).

Using a for-loop that repeats iteration for 5 times, prompt user to input temperature in Fahrenheit unit and assign it as the value of current element of the array. (Line 11 - 12). Please note the nextDouble() method is used to read user input as the data type of input temperature is expect in decimal format.

At this stage, we are ready to create the required function convert2Cels() that takes two input arguments, the temperature array,  <em>tempArray</em> and number of array elements, <em>n </em>(Line 23).  Using a for-loop to traverse each element of the tempArray and apply the formula to convert the fahrenheit to celcius.  

Next, we call the function <em>convert2Cels() i</em>n the main program (Line 15) and print out the temperature (in celsius) in one single column (Line 17-19). The <em>%.2f</em> in the print statement is to display the temperature value with 2 decimal places.

8 0
4 years ago
Animals living in burrows under the ground is an interaction between the biosphere and the
Dovator [93]

Answer:

Geosphere

Explanation:

The geosphere is made up of the rocks and minerals of the earth found in the ground.

7 0
3 years ago
Other questions:
  • ​Harrison works at a nationally known grocery store chain. He is analyzing sales data from the past five years to determine whic
    12·1 answer
  • If a user wants to change one small section of the formatting of a document and leave the rest the same, which process should be
    14·1 answer
  • TRUE/FALSE<br><br> The Interrupt Flag (IF) controls the way the CPU responds to all interrupts.
    6·1 answer
  • Describe the difference between cellular, wi-fi and wired networks.
    8·1 answer
  • When you use the .net data provider objects to retrieve data from a database, you can store the data in an object called a?
    8·1 answer
  • Which term originated on social media?<br> O A. LOL<br> O B. Unlike<br> O C. Notebook<br> D. Word
    7·2 answers
  • Inappropriate use of technology makes it easier for cyber bullies to <br> others.
    13·2 answers
  • Can someone be my friend,don't friend me until i ask you Questions
    14·1 answer
  • Select the correct answer.
    14·1 answer
  • An editing functions used to move selected text or objects to the Clipboard, from which they may be pasted elsewhere in the pres
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!