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
cluponka [151]
3 years ago
9

What would be the results of the following code? int[] x = { 55, 33, 88, 22, 99, 11, 44, 66, 77 }; int a = 10; if(x[2] > x[5]

) a = 5; else a = 8; A. a = 5 B. a = 8 C. a = 10 D. This is a compilation error, you cannot compare array elements.
Computers and Technology
1 answer:
Nezavi [6.7K]3 years ago
6 0

Answer:

The answer is "Option A".

Explanation:

In the given code an integer array "x" is defined, that stores some elements and another integer variable "a" is declared, that holds a value that is "10". In this code a conditional statement is defined, which checks array element value, in if block element of array that position is 2 is greater then the element of array that position is 5.if this condition is true, so variable a value is change that is equal to 5. In else block if the above condition is not true so the value of a variable is equal to 8, and another options is wrong that can be described as follows:

  • In option B, The given condition is not false, that's why it is not correct.
  • In option C, The value of variable a is changed when condition is true or false, that's why it is not correct.
  • In option D, It is wrong because we can compare array elements.

You might be interested in
Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
Lynna [10]

Answer:

def print_popcorn_time(bag_ounces):

 if bag_ounces<3:

   print("Too Small")

 elif bag_ounces>10:

   print("Too Large")

 else:

   bag_ounces = bag_ounces*6

   print("%s Seconds\n" % bag_ounces)    

Explanation:

  • Using Python Programming Language
  • The function is defined to accept an int parameter
  • Within the function body, if...elif and else statements are used to print the desired output
  • note the use of the %s placeholder (formated output) and \n for a new line in the final print statement
4 0
3 years ago
¿En qué países se ha implementado un sistema de vigilancia a través de drones?, ¿qué aspectos positivos y negativos ha generado?
mel-nik [20]

Answer:

17 países.

Explicación:

Hay diecisiete países que tienen vehículos aéreos no tripulados armados y donde se ha implementado un sistema de vigilancia con drones. Los drones son excelentes para recopilar grandes cantidades de datos de imágenes. Se puede implementar fácilmente para la vigilancia y mantener la seguridad. Se puede conducir a través de la computadora, no del piloto en él, por lo que el piloto se guarda. Los aspectos negativos de los drones es que tienen tiempos de vuelo cortos y el clima puede afectar fácilmente a los drones. Las operaciones precisas son difíciles y también eliminan futuros trabajos.

7 0
3 years ago
What is a power surge?
Damm [24]
D. A spike of electricity. They are fast and have a short duration.
4 0
2 years ago
Which option is the easiest way to configure macros in Access 2016?
zhuklara [117]
Number 2
Have a nice day
6 0
3 years ago
Compare userNumber with compareNumber and display 'Numbers are not equal' if the numbers are different. Then, display 'Variables
masya89 [10]

Answer:

Following are attached images that will help you understand the complete code. The code is tested with different variables and different outputs are obtained. All the necessary description is given in the form o comments inside the code.

Explanation:

3 0
3 years ago
Other questions:
  • Create a function average_temp(s) that accepts a file name s that contains temperature readings. Each line in the file contains
    15·1 answer
  • Who is the last person appointed to the u.s supreme court
    11·1 answer
  • 1. [2 points] Write a function to compute the volume of a sphere, given its radius. 2. [2 points] Write a recursive function to
    7·1 answer
  • PLEASE HELP QUICK WILL GIVE BRAINLY
    6·1 answer
  • When backing up a database, what is added to the file name?<br> On g metrix
    9·1 answer
  • Match the organelles to their functions.
    6·1 answer
  • Create a PHP page that contains an array of at least 20 movie titles or book titles (your choice). The HTML page should have an
    7·1 answer
  • Why I/O modules is needed between system bus<br>and I/O devices?​
    15·1 answer
  • An update anomaly can occur if A. an instance of the same data is stored in two or more places in the database. B. a data elemen
    7·1 answer
  • In what medium do web applications operate?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!