Computer Science- Test 1 Review
The symbol used to create a comment is:
#
What is the correct order for the steps the compiler uses in translating code?
Check for mistakes, Translate commands to machine language, Run the commands
Which of the following about computers is NOT true?
Computing devices translate digital to analog information in order to process the information.
What is one downside of converting analog information to a digital format?
Some information may be lost when it is converted.
The two basic categories of variable data types are:
Strings and numbers
What is output by the following? print ("Twinkle, \ttwinkle, \tlittle star")
Twinkle, twinkle, little star
What is output by the following? Assume the user enters 5 and 4 x = input ("Enter a number: ") y = input ("Enter a number: ") print ("Values: " + x + y)
Values: 54
Consider the following code: x = input ("What year is it?") print x The value stored in x is:
a String
Consider the following code: x = "apple" y = x z = "banana" print (x + " " + y + "\n" + z) What is output?
apple apple banana
Consider the following code: print ("computer" + "science") What is output?
computerscience
Which of the following correctly inputs two numbers and print the sum?
n1 = int(input("Enter a number: ")) n2 = int(input("Enter a number: ")) print("The answer is: " + str(n1+n2))
Which of the following controls computer memory?
operating system
Which of the following is NOT an input device?
printer
Which of the following will correctly output: I know there's a proverb which that says "To err is human," but a human error is nothing to what a computer can do if it tries. - Agatha Christie
quote = "\"To err is human,\"" print ("I know there's a proverb which that says \n"+ quote + "\nbut") print ("a human error is nothing to what a computer") print ("can do if it tries.\n\n- Agatha Christie")
What is output by the following? print (type("95"))
<type 'str'>
What is input?
Putting information into the computer
When do we use numbers instead of strings?
When you need to do calculations
What command is used to change a string into a number?
int
Which of the following is a legal variable name?
temperatureAM
Which of the following are true about main and secondary memory?
Main memory is short term memory used by the CPU in processing commands, secondary memory is more permanent and used for storage.