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
eduard
3 years ago
13

What is the value of numX when this program is executed? if 3 < 5 and 8 != 3: numX = 3 else: numX = 7

Computers and Technology
2 answers:
Juliette [100K]3 years ago
6 0

Answer:

numX = 3

Explanation:

First, let's analyze what the code is showing:

If both conditions in the if-statement are true, then numX = 3. If one or both conditions are false, then numX = 7 ('and' means that both conditions have to be true for the if-statement to become true).

- this statement is true.

!=  - this statement is also true (!= means 'not equal').

Since both conditional statements are true, then numX must equal .

Hatshy [7]3 years ago
3 0

Answer:

numX = 3

Explanation:

First, let's analyze what the code is showing:

If both conditions in the if-statement are true, then numX = 3. If one or both conditions are false, then numX = 7 ('and' means that both conditions have to be true for the if-statement to become true).

3 - this statement is true.

8 != 3 - this statement is also true (!= means 'not equal').

Since both conditional statements are true, then numX must equal 3.

Hope this helps :)

You might be interested in
Take the average of some numbers. Show all the numbers that are below average. You can assume that there will not be more than 2
olchik [2.2K]

Here is code in java.

import java.util.*; // import package

class Main //  creating class

{

public static void main (String[] args) // main method

{

Scanner br=new Scanner(System.in); // scanner class for input

       int []a=new int[20]; // declaring array

       int count=0,x,j; // creating variable

       int sum =0;

       System.out.println("Enter a weight (0 to stop):");

       x=br.nextInt(); // taking input

while(x!=0) // iterating over the loop

       {

           a[count] = x;

           count++;

           System.out.println("Enter a weight (0 to stop):");

           x=br.nextInt();

}

       for( j=0;j<count;j++) // iterating over the loop

       {

       sum+=a[j];

       }

       double avg = sum/(double)count;

       System.out.println("The total is: "+sum);

       System.out.println("The average is: "+avg);

       System.out.println("Here are all the numbers less than the average: ");

     for( j=0;j<count;j++) //  // iterating over the loop

       {

           if(a[j]<avg)

           System.out.print(a[j]+" ");

       }

}

}

Explanation:

First create an object of "Scanner" class to read input from the user.

Create an array of size 20, which store the number given by user.Ask user

to give input and keep the count of number in the variable "count". If user

give input 0 then it will stop taking input.And then calculate sum of all the

input.It will calculate average by dividing the sum with count and print it.

It will compare the all elements of array with average value, if the element

is less than average, it will print that element.

Output:

Enter a weight (0 to stop):

1

Enter a weight (0 to stop):

2

Enter a weight (0 to stop):

3

Enter a weight (0 to stop):

4

Enter a weight (0 to stop):

5

Enter a weight (0 to stop):

6

Enter a weight (0 to stop):

7

Enter a weight (0 to stop):

8

Enter a weight (0 to stop):

9

Enter a weight (0 to stop):

10

Enter a weight (0 to stop):

0

The total is: 55

The average is: 5.5

Here are all the numbers less than the average:

1 2 3 4 5

6 0
3 years ago
Chegg Suppose the heap is a full tree, size 2^n-1. what is the minimum number of steps to change a min heap to a max heap. Show
adoni [48]

Answer:

Explanation:

We start from the bottom-most and rightmost internal node of min Heap and then heapify all internal modes in the bottom-up way to build the Max heap.

To build a heap, the following algorithm is implemented for any input array.

BUILD-HEAP(A)

   heapsize := size(A)

   for i := floor(heapsize/2) downto 1

       do HEAPIFY(A, i)

   end for

Convert the given array of elements into an almost complete binary tree.

Ensure that the tree is a max heap.

Check that every non-leaf node contains a greater or equal value element than its child nodes.

If there exists any node that does not satisfy the ordering property of max heap, swap the elements.

Start checking from a non-leaf node with the highest index (bottom to top and right to left).

4 0
2 years ago
failure of the _ cylinder will often result in sudden unexpected loss of the ability to stop the vehicle
grin007 [14]

Failure of the <u>Brake master </u>cylinder will often result in sudden unexpected loss of the ability to stop the vehicle

<u>Explanation:</u>

The ability to stop the vehicle lies with the Brakes. If brakes of a vehicle do not work properly then it might become difficult to stop the vehicle. This happens when a cylinder called brake master cylinder fails.

The brake master cylinder might not work properly with the passage of time or it can form internal leaks. This is the master cylinder and it controls other cylinders in a vehicle. Its failure affect the brakes badly, it will be unsafe to drive such a vehicle.

5 0
2 years ago
Help it's the last question quickkk​
aniked [119]
I would say the answer is b, but ⟟ might be wrong
7 0
3 years ago
NIST recommends selecting cloud providers that support strong encryption, have appropriate redundancy mechanisms in place, emplo
WITCHER [35]

Answer:

The answer is "Option a".

Explanation:

In cloud computing, it is also known as the model, that enables you for accessible, convenient, through the-demand network access to global computer resources, which can be rapid to get and published via low administrative effort.  

Its recommending selection for the cloud providers support for the robust encryption, that has adequate replication processes in place, use user authentication, or provide ample clarity to customers regarding mechanisms that defend subscriptions against other subscriptions and the supplier.

8 0
3 years ago
Other questions:
  • Use ________ resolution when recording human speech in an audio file.
    14·1 answer
  • 2. What's the keyboard command that will allow you to "copy" text?
    8·2 answers
  • ​_____ was the first commercially successful computer. ​z3 ​eniac ​univac ​colossus
    13·1 answer
  • It chapter 2 pennywise
    13·1 answer
  • The
    6·2 answers
  • What number system that has 16 numerals
    11·2 answers
  • 10010 - 1011 binary subtraction​
    5·1 answer
  • Which of the following is a table which can be rearranged to analyze data in a variety of ways?
    13·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • Send link for a qc or paddle
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!