sound, video, and on screen text?
output
What is the difference between modular division and normal division?
Modular → Remainder
What are nested ifs and why do we use them?
Nested ifs is putting one if statement inside another and we use them to check if a condition is true or false multiple times.
What is the difference between a computer model and simulations?
Computer models recreate realistic scenarios, simulations are experiments based off of them.
Information in the real world?
Analog
What is a terabyte?
2^40 bytes
Write the code if the variable x is the same as zero, if it is, print “x = 0”
if(x == 0):
print(“x = 0”)
Write a loop that counts back from 80 to 2 (You can only count back by even numbers)
for i in range(80,0,-2):
print(i)
If the computer loses power all information is lost here?
Main memory
Write out the math functions from the math module?
math.pow(a,b)
math.sqrt(a)
math.fabs(a)
What is a boolean?
A boolean is a keyword used to test conditions if it is true.
Identify the parameter in the following code:
X = int(input(“Enter a number: “))
Y = int(input(“Enter a number: “))
if(X>Y):
print(“X is greater than Y”)
else:
print(“Y is greater than X”)
x and y
What does IDE stand for, and what is it?
Integrated Development Environment; Also called a programming environment, it allows the user to write the program, run the program, and debug the program all within one application.
43154782%3223 (no calculator)
2035
What are 5 things that algorithms must have?
Have an order, have clear instructions, operations that can be done by a computer, produce a result, and stop in a finite amount of time
What’s a count variable, and what is it used for?
A variable written into code that counts how many times a loop runs, and stops it once the set limit is met.
Correct the errors to make the output;
.name = input(‘’Enter a name: ‘’)
Adj1 = Input(‘’Enter an adjective: ‘’)
adj2 = input(‘’Enter an adjective: ‘’)
adv = input(‘’Enter an adverb: ‘’)
food1 = input(‘’Enter a food: ‘’)
food2 = input(‘’Enter another food: ‘’)
noun = input(Enter a noun: ‘’)0
place = input("Enter a place: ‘’)
vb = input("Enter a verb: ‘’)
print("Let's play Silly Sentences!\p’’)
print(name - ‘’ was plannng a dream vacation to ‘’ + place + ‘’,’)
print(name + ‘’ was specially looking forward to trying the local\n’cuisine, including " = adj1 _ ‘’ ‘’ + food1 0 ‘’ and ‘’ + food2 + ‘’.\p’’)
print(name + " will have to practice the language " + adv + " to\pmake it easier to ‘’ + vd + ‘’ with people.\p’’)
print(name + " has a long list of lights to see, including the\p" + Noun + " museum and the " + adJ2 + " park")
.Let's play Silly Sentences!
Enter a name: Grace
Enter an adjective: stinky
Enter an adjective: blue
Enter an adverb: quietly
Enter a food: soup
Enter another food: bananas
Enter a noun: button
Enter a place: Paris
Enter a verb: jump
Grace was planning a dream vacation to Paris.
Grace was especially looking forward to trying the local
cuisine, including stinky soup and bananas.
Grace will have to practice the language quietly to
make it easier to jump with people.
Grace has a long list of sights to see, including the
button museum and the blue park.
This code is meant to find the greatest out of 11 numbers. Fix the code on the board:
n1 = float(input("Enter a number: ")
n2 = floa(input("Enter a number: )
n3 = float(input(Eter a number: "))
n = flat(input("Enter a number: ")
n5 = (input("Enter a number: "))
n6 = float(input(Enter anumber: "))
n7 = loat(input("Enter a number: ")
n8 = floatinput("Enter a number: "))
n = flot(input(Enter a number: ))
n1 = float(input("Enter a number: "))
n1 = input("Enter a number: "))
min(n1, n2, n3, n4, n5, n6, n7, n, n9, n1)
n1 = float(input("Enter a number: "))
n2 = float(input("Enter a number: "))
n3 = float(input("Enter a number: "))
n4 = float(input("Enter a number: "))
n5 = float(input("Enter a number: "))
n6 = float(input("Enter a number: "))
n7 = float(input("Enter a number: "))
n8 = float(input("Enter a number: "))
n9 = float(input("Enter a number: "))
n10 = float(input("Enter a number: "))
n11 = float(input("Enter a number: "))
print(max(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11))
x = 43
if(x == 43):
pr!nt("x = 43")
x = x / 0
if(x == 54)
print("True") #what is output
Line 3: SyntaxError: bad token T_OP
What is wrong with the following code?
X = integer(input(“Enter a number’):
while(x!=0):
print(x)
2nd Quotation Mark
No loop control variable