Quiz
Intro to Computer Science S2 Chapter 7
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (55)
1What is output by the following code?
print(chr(50))- A50
- B2
- C49
- Derror
2Which of the following is NOT true?
- ACharacters can contain digits
- BCharacters can contain symbols
- CCharacters can contain letters
- DCharacters can contain booleans
3Which of the following built in functions returns the ASCII code representation of an input character?
- Aord()
- Bupper()
- Cstr()
- Dint()
4________ can be individual letters, digits, or symbols
- Aints
- Bfloats
- Cdoubles
- Dcharacters
5ASCII stands for -
- AAmerican Science Cohort for Independant Information
- BAmerican Scholars Core for Ingenious Innovation
- CAmerican Sustained Computers for International Inquiries
- DAmerican Standard Code for Information Interchange
6Which data type is NOT used for calculations?
- Astring
- Bboolean
- Cfloat
- Dinteger
7Which function tells Python to handle a value as a string?
- Astr()
- Blen()
- Cint()
- Dinput()
8The _____ method changes strings to uppercase letters
- Acapitalize()
- Blen()
- Cupper()
- Dint()
9Consider the following code:
print("zip code: 10036".capitalize())
What is output?- AZip Code: 10036
- BZip code: 10036
- Czip code: 10036
- DZIP CODE: 10036
10Consider the following code:
val = "The temperature is 82 degrees Fahrenheit."
print(val.isdigit())
What is output?- ATrue
- B82
- CThe temperature is 82 Fahrenheit.
- DFalse
11Consider the following code:
phrase = "Big Data means processing massive data sets. "
print(phrase.find("D"))
What is output?- A3
- B4
- CFalse
- DTrue
12Consider the following code:
phrase = "Python"
print(phase.find("P"))
What is output?- AFalse
- BTrue
- C0
- D1
13Why do we use external data files?
- Ato store information in active memory
- Bto create subprograms
- Cto repeat code
- Dto process large amounts of data
14Text files contain ______.
- Awords
- Bcharacters
- Cnumbers
- DAll listed
15Active memory is ______ and _______
- Apermanent, fast
- Btemporary, slow
- Cpermanent, slow
- Dtemporary, fast
16Which of the following carries out the commands of running programs?
- AComputer Processing Unit
- BUniversal Serial Bus
- CArithmetic Logic Unit
- DCentral Processing Unit
17Which of the following is the first step needed when writing a program designed to get data from an external data file?
- APrint to the file
- BSwap the file
- CSearch the file
- DOpen the file
18The _____ command sends information to the file
- Aread()
- Bopen()
- Cclose()
- Dwrite()
19_________ the file saves the data outputted by the program
- AReading
- BRunning
- CClosing
- DOpening
20Why do we output to data files?
- ATo save the output a program generates
- BTo make decisions in programs
- CTo process commands by the CPU
- DTo use data imported from an external file in your current program
21Which of the following CORRECTLY opens a file for output?
- Aopen("sample.txt", "w")
- Bopen("sample.txt", "r"")
- Cinfile = open("sample.txt", "w")
- Dinfile = open("sample.txt", "r"")
22The _____ command returns the length of a string
- Alen()
- BASCII()
- Cord()
- Dchr()
23The ______ command changes an ASCII value to its character
- AASCII()
- Blen()
- Cord()
- Dchr()
24Which of the following can a character NOT contain?
- AA number
- BA symbol
- CA letter
- DA string
25Consider the following code:
print("at 10 am the phone rang. i answered.".capitalize())- AAt 10 AM the phone rang. I answered.
- BAt 10 AM the Phone Rang. I Answered.
- CAt 10 am the phone rang. i answered.
- DAT 10 AM THE PHONE RANG. I ANSWERED.
26Consider the following code:
val = "58742"
print(val.isdigit())
What is output?- AFalse
- BTrue
- CThere is an error
- DNo output
27Consider the following code:
phrase = "Big Data means processing massive data sets. "
print (phrase.find("data"))
What is output?- A4
- B5
- C35
- D34
28Which of the following DOES NOT correctly check if the digit 8 is in the string represented by the variable word?
- Aword.find(str(8))
- Bword.find('8')
- Cword.find(8)
- Dword.find("8")
29Consider the following code:
print(str(9) + str(75))
What is output?- A84
- B984
- CNo output, there is an error
- D975
30The _______ data type holds values NOT used for calculations
- Ainteger
- Bboolean
- Cfloat
- Dstring
31Which of the following is true about ASCII?
- AThe ASCII chart is not used by mobile devices
- BThe ASCII chart is different on PC and Apple
- CThe ASCII chart matches characters to numbers so they can be stored in memory
- DThe ASCII chart was invented in the 1990's for use on the Internet
32Compression is __________
- Areducing the size of information
- Bpart of a loop
- Cconverting numbers to strings
- Da boolean function
33________ compression is when data is lost in the compression, while _________ compression is when no information is lost and the original can be restored exactly
- Adigital; lossless
- Blossless; lossy
- Clossy; lossless
- Dlossy; digital
34While capturing images and sounds digitally is convenient, one challenge to storing and sending images and audio files is that:
- Acan take up large amounts of memory
- Bcannot be stored in secondary memory
- Ccannot be processed by the Central Processing Unit
- Dcannot be saved in standard file types
35When we digitize information we represent it in ________.
- Astrings
- Bbinary
- Ccharacters
- Dintegers
36The _______ command changes a character to its ASCII value
- Aord()
- Bchr()
- CASCII()
- Dlen()
37Consider the following code:
print(9 + str(75))
What is output?- A975
- B984
- C84
- DNo output, there is an error
38________ compression is when data is not lost in the compression, while _______ compression is when information is lost and the original cannot be restored exactly
- Adigital, lossless
- Blossy, digital
- Clossy, lossless
- Dlossless, lossy
39What is one issue with digitally representing information?
- Ait cannot be input from external files
- Bthe Central Processing Unit cannot process it
- Cit can take up large amount of memory
- Dit cannot be stored in secondary memory
40word = "hamster collar"
print(len(word))
What is output?- A13
- BNo output, there is an error
- C15
- D14
41Consider the following code:
word = "invisible symbol"
print(word.upper())
What is output?- AInvisible symbol
- BINVISIBLE SYMBOL
- CNo output, there is an error
- DInvisible Symbol
42Consider the following code:
word = "benevolent pigeon"
print(word.replace("e", "*"))
What is output?- Ab*nevolent pigeon
- Bb*n*vol*nt pig*on
- Cb*nevolent pig*on
- Dbenevolent pigeon
43Suppose that you need to access a data file named "students.txt" to hold student names and GPAs. If the user needs to look at the information in the file, which command could be used to open this file?
- Af = open('students.txt', 'w')
- Bf = open('students.txt', 'r')
- Cf = write('students.txt', 'r')
- Df = open('students.txt', 's')
44Consider the following code:
word = input ("Enter a phrase: ")
c = 0
for i in range(26):
if (word.upper().find(chr(i + 65)) >= 0):
print ("Found: " + chr(i + 65))
c = c + 1
print ("\n" + str(c) + " Letters found")
What is output if the user enters "open the door"?- AFound: D
Found: E
Found: H
Found: N
Found: O
Found: P
Found: R
Found: T
10 Letters found - BFound: O
Found: P
Found: E
Found: N
Found: T
Found: H
Found: D
Found: R
8 Letters found - CFound: d
Found: e
Found: h
Found: n
Found: o
Found: p
Found: r
Found: t
10 Letters found - DFound: D
Found: E
Found: H
Found: N
Found: O
Found: P
Found: R
Found: T
8 Letters found
- AFound: D
45What is one advantage of using external data files?
- AInputting large amounts of data from a file instead of the keyboard
- BInputting data from the Internet instead of a keyboard
- Crepeating data input from multiple sources
- Drepeating commands in programs
46_______ holds running programs and the information they are using
- AMain memory
- Bdigital storage
- Cbinary
- Da data file
47Which commands sends information to a data file?
- Aopen()
- Bprint()
- Cwrite()
- Doutfile()
48Why do we use the close command when outputting to a data file?
- Ato clear the data from secondary memory
- Bto clear the data from the CPU
- Cto save the data to secondary memory
- Dto save the data to the CPU
49Why do we use while loops when processing data files?
- AWe know exactly how many lines are in the file
- BBecause we are inputting values from the keyboard
- CWe do not know ahead of time how many lines are in the file
- DBecause files contain special characters to mark the end of the file
50Which of the following is used to mark the end of the line in a text file?
- A\t
- B\e
- C\n
- D\f
51Which of the following correctly opens a file for input?
- Aopen("sample.txt", "r")
- Binfile = open("sample.txt", "w")
- Cinfile = open('sample.txt", "r")
- Dopen("sample.txt", "w")
52Which of the following is NOT one of the three steps needed to import data from a text file?
- AAdd comments to each line of data in the file
- BInput and process the data
- CClose the file
- DOpen the file
53The Central Processing Unit carries out the commands from programs running in
- Aflash drive
- Bmain memory
- Cdata files
- Doutput file
54Main memory is ______ and _______
- Apermanent, slow
- Btemporary, fast
- Ctemporary, slow
- Dpermanent, fast
55Text files contain
- Afloats
- Bimages
- Ccharacters
- Donly words
Informationen
- Beschreibung
- 10th grade Computer Science Quiz am Intro to Computer Science S2 Chapter 7, erstellt von Grant Eversole am 07/05/2018.
- Autor
- Grant Eversole
- Sprache
- English
- Aufrufe
- 1
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz