Search Header Logo

CSC401 T3-SBQ1

Authored by Ayesha Abdullah

Computers

9th Grade

Used 2+ times

CSC401 T3-SBQ1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1.Write a Python program that will be used as a temperature checker. The program will keep on asking the user to enter the temperature until the while condition is false.

Use the pseudocode below to create your program :


a) Ask the user to Enter a temperature.

b) In the while loop condition, IF the temperature entered is above >= 62, then print “Too Hot”

c) After printing “Too Hot”, ask the user to enter the temperature again.

d) When the above while condition is not met then print “Temperature OK”

e) Save your Python File as Task1.py

temp = float(input("Enter temperature : "))

while temp >=62 :

print("Too Hot")

temp = float(input("Enter temperature again : "))

print ("Temperature OK")

temp = float(input("Enter temperature : "))

while temp <=62 :

print("Too Hot")

temp = float(input("Enter temperature again : "))

print ("Temperature OK")

temp = float(input("Enter temperature : "))

while temp >=62 40:

print("Too Hot")

else:

print ("Temperature OK")

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

1. Write a Python program that will be used finding the perfect number. The program will keep on asking the user to enter their number until the while condition is false.

Use the pseudocode below to create your program :


· Ask the user to Enter the number.

· In the while loop, print “Try Again”, if the number is not equal to 78

· When the above while condition is not met then print “PERFECT”

· Save your Python File as Task1.py

num = float(input("Enter number : "))

while num != 78:

print("Try Again")

num = float(input("Enter number again : "))

print ("PERFECT")

num = float(input("Enter number : "))

while num == 78:

print("Try Again")

num = float(input("Enter number again : "))

print ("PERFECT")

num = float(input("Enter number : "))

while num <78:

print("Try Again")

num = float(input("Enter number again : "))

print ("PERFECT")

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of loop structure repeats the code a specific number of times?

condition -controlled loop

number-controlled loop

count-controlled loop

boolean-controlled loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the values that the variable num contains through the iterations of the following for loop?

for num in range(2, 9, 2):

2, 3, 4, 5, 6, 7, 8, 9

2, 5, 8

2, 4, 6, 8

1, 3, 5, 7, 9

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the values that the variable num contains through the iterations of the following for loop?

for num in range(4):

1,2,3,4

0,1,2,3,4

1,2,3

0,1,2,3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be displayed after the following code is executed?

total = 0

for count in range(1,4):

total += count

print(total)

1

3

6

5

1

4

6

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be displayed after the following code is executed?

total = 0

for count in range(4,6):

total += count

print(total)

4

9

4

5

6

4

5

9

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?