1.1-1.6 questions Flashcards

1
Q

Computer science allows ppl to?

  • create new software
  • solve problems
  • all of the above
  • communicate
A
  • all of the above
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

_____ is based on a set of very specific rules for communicating.

  • Familiar Language
  • Natural Language
  • Instinctive Language
  • Formal Language
A

Formal Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
Currently there is over \_\_\_\_\_\_\_\_\_\_\_\_\_ unfilled jobs in the US in computer science.
  1000 
  1.5 million 
  100,000 
  1 billion
A

1.5 million

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
\_\_\_\_\_\_\_\_\_\_\_\_ is designed to be very clear and work consistently every time it is used.
  Precise Language 
  Formal Language 
  Familiar Language 
  Natural Language
A

Formal Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The print command in Python can be written as PRINT or print.
True
False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
What is wrong with the following line of code?
print(Hello World)
  It needs " around Hello World
  It cannot print words 
  It needs # around Hello World
  print should be PRINT
A

It need “ around Hello World

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True or False: When running the print command as seen in the code below, the text that is output will be displayed in quotation marks.

print(“Hello there!”)
True
False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
What is the Python command that can be used to display text and numbers on the screen?
  print
  python
  \+
  hello
A

print

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
Short term memory used by the CPU.
  main memory 
  input 
  output 
  secondary memory
A

main memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
Which of the following carries out the commands in programs?
  CPU 
  main memory 
  hardware 
  power source
A

CPU(Central Processing Unit)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
\_\_\_\_\_\_\_\_\_\_\_\_\_ is information the user sends to the computer.
  secondary memory 
  input 
  program 
  software
A

input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
Programs that run on hardware are called:
  software 
  input 
  computer 
  output
A

software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is output by the following line of code?
print(“I\tLove Python”)

I Love Python
I Love Python
I Love Python
I\tLove Python

A

I Love Python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What would be output by the following code?
print(“Hello”, end=””)
print(“ Jackson”)

HelloJackson
Hello Jackson
Hello, end=”” Jackson

Hello

Jackson

A

Hello Jackson

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
When the computer translates digital information to information humans can use, it is called \_\_\_\_\_\_\_\_\_\_\_\_\_.
  input 
  output 
  escape characters 
  command
A

output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
\_\_\_\_\_\_\_\_\_\_\_\_ are special output characters marked with a \.                           
  Escape sequences 
  Output sequences 
  Strings 
  Print characters
A

Escape Sequences

17
Q

What is output by the following line of code?
print(5 + 9*2)

592
23
518
28

A

23

18
Q
What do we call notes in computer code for the programmer that are ignored by the compiler?
  Escape characters 
  Print commands 
  Output 
  Comments
A

comments

19
Q

This code is supposed to accept a word as input, and then print that word to the screen.
input(“Enter a word: “)
print(w)

What is the error in this code?
The input needs to be stored to a variable, w
Nothing, there is no error.
When we print(w), the w should be in quotes

A

Input needs to be stored with the variable w

20
Q
Which of the following is a correct variable name?
  7temperature 
  low_Temperature 
  Low temperature 
  low--temperature
A

low_Temperature

21
Q

What is output by the following lines of code if we input the name “Sally”?

n = input("What is your name? ")
print("Hello there " + n)
  There is an error since the input command needs a str 
  Hello there Sally 
  Hello there 0 
  Hello there n
A

Hello there Sally

22
Q

Which of the following is NOT true about variables?

  • Variable names can be words: such as temperature or height.
  • The value stored by a variable cannot be changed after it is assigned.
  • Variables are a name for a spot in the computer’s memory.
  • The value stored by a variable can be changed after it is assigned.
A
  • The value stored by a variable cannot be changed after it is assigned.
23
Q

Assume the user types in 7 and 10. What is output by the following?

num1 = input(“Enter a number: “)
num2 = input(“Enter a number: “)
print(num1 + num2)

17
710
No output, there is an error.
71

A

710

24
Q

Which command converts a number to a string?

num()

int()

str()

word()

A

str()

25
Q

Which of the following is true about strings?

  • They do not let the user type in letters, numbers and words
  • They cannot be stored to a variable
  • An input (unless otherwise specified) will be stored as a string
  • They are used for arithmetic calculations
A
  • An input (unless otherwise specified) will be stored as a string
26
Q

What is wrong with the following code?

num1 = int(input(“Enter a number: “))
num2 = int(input(“Enter a number: “))
num3 = int(input(“Enter a number: “))
print(“The average is: “ + (num1 + num2 + num3)/3)

  • The last line should be print(“The average is: (num1 + num2 + num/3))
  • It needs a int() command
  • It needs a str() command
  • The variables should be 1num, 2num, 3num
A

it needs a str() command

27
Q

Which of the following lines of code correctly inputs a number?

  • n = input(“Enter a value: “)
  • n = str(input(“Enter a value: “))
  • n = int(input(“Enter a value: “))
  • n = num(input(“Enter a value: “))
A
  • n = int(input(“Enter a value: “))
28
Q
\_\_\_\_\_\_\_\_\_\_\_\_\_ data is what is translated to digital format so it can be stored in a computer.
Digital
Binary
Secondary
Analog
A

Analog