Question: Given the following code x = 5 y = 5 if (x >5) or (y >5): print( 'A' ) else : print( 'Z' ) Which

Given the following code

x = 5 y = 5 if (x >5) or (y >5): print('A') else: print('Z') 

Which of the following is an equivalent program? (See DeMorgan Laws document )

x = 5 y = 5

if not(x >5) and not(y >5): print('A') else: print('Z') 
 

x = 5 y = 5

if not(x > 5) and not(y > 5): print('Z') else: print('A') 

x = 5 y = 5

if not(x >5) or not(y >5): print('A') else: print('Z') 

x = 5 y = 5

if (x >5) and (y >5): print('Z') else: print('A') 

What would be printed if the following python code was executed

X = 4 C = 0 while (X >0): if (X % 2 == 0): C = C + 1 else: C = C -1 X = X - 1 print(C) 
 

a. 2 3 4 b. 3 4 5 c 2 3 4 5 d. None of these

What would be printed if the following instructions were executed?

X = 4

while (X > 0):

print(X-1)

X = X 1

a. 32 1 b. 4 32 1 c. 3 21 0 d. None of these

Answer: d. None of these

If the sum of the degrees of all vertices in a graph is 20 then the number of edges the graph will have is :

a. 10 b. 40 c 30 d. None of these

Students are required to take two tests and write a review paper in a course. However, students who score 90 or above in both tests do not have to write the review paper. Which of the following python statements correctly determines whether a student needs to write a paper?

A.

if test1 < 90 and test2 < 90:

print('you need to write the review paper')

else:

print('you do not need to write the review paper')

B.

if test1 >= 90 or test2 >= 90:

print('you do not need to write the review paper')

else:

print('you need to write the review paper')

C.

if test1 < 90 or test2 < 90:

print('you need to write the review paper')

else:

print('you do not need to write the review paper')

D.

None of the code above correctly determines if you need to write a paper

6.Graph Theory document Question #1 (minimum number of edges that need to be added to have an Euler path)

1

2

3

4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!