CS125 Test 3 Questions (Last 3 Quizzes Combined)

¡Supera tus tareas y exámenes ahora con Quizwiz!

(velocity, height) in the function def accelSpeed(velocity, height) is in the part of a function called the: A. index B. parameters C. limits D. variables E. None of the above

B

A loop pattern that asks the user whether to continue on each iteration is called A. continual loop B. Interactive loop C. sentinel loop D. definite loop E. none of the above

B

A loop that never ends is known as? A. busy loop B. infinite loop C. indefinite loop D. never ending loop E. termination loop

B

A sentinel loop is when the loop continues to process data until: A. The user performs the quit command B. It reaches a value called the sentinel C. The loop crashes the program D. The try and except commands are used E. None of the above

B

A statement that branches into multiple other options is called what? A. branch statement B. decision tree C. tree statement D. web decision E. simple decision

B

Algebraic laws that Boolean expressions follow are known as Boolean ____ or ____. A. math, science B. logic, algebra C. laws, orders D. code, script E. None of the above.

B

Boolean expressions can be either ____ or _____. A. Out of Bounds, Incorrect B. True, False C. Specified, Unspecified D. Invaluable, Worthless E. None of the above.

B

Python has a built-in function called______that returns the largest of its parameters. A. Network. B. Max. C. Tree D. Script. E. Value.

B

Special statements that allow programs to execute different sequences of instructions for different cases are called: A. control structures B. decision structure C. turns D. choice structures E. None of the above

B

Statements that allow a program to execute different sequences of instructions for different cases are called A. control structures B. decision structures C. control statements D. decision statements E. none of the above

B

We can't use a definite loop unless we know the number of ________ ahead of time? A. variables B. iterations C. constants D. loops E. All of the above

B

What are the six relational operators in Python? A. +, -, <,>, ?, } B. <, >, <=, >=, ==, != C. <, >, = , >=, ==, != D. <, >, + , -, ==, != E. none of the above.

B

What are the three Boolean operators? A. +, -, = B. "and" , "or" and "not" C. "and", "or" and "yes" D. "true", "false" and "equal" E. "True" , "False" and "Equal"

B

What are the three strategies for writing a program to compare more than two values? A. Design, Implementation, and Debugging. B. Comparing them all, Decision Tree, and Sequential Processing. C. Decision Tree, Decision Bush, and Decision Flower. D. Compare/contrast, Addition, and Subtraction. E. None of the above.

B

What command allows you to record your terminal/command prompt window and what command ends it? A. script B. script, Ctrl+D C. Script, Ctril+D D. Ctrl+D, script E. script, quit

B

What command is used to make a directory in Unix? A. mkir B. mkdir C. mkdr D. mkdi E. none of the above

B

What command will record what the user is doing on the screen? A. typescript B. script C. record D. cp screen E. none of the above

B

What do you need to do if your program prints out "None" in your output? A. run the program again. B. check to see whether you missed a return statement. C. delete a return statement. D. rename the program. E. none of the above.

B

What does .format do? a) formats the entirety of the code. b) allows you format string in any way you want. c) formats all the strings. d) formats all your functions.

B

What does it mean that strings are lexicographic? A. Lowercase letters are sorted before uppercase by Unicode standards B. Uppercase letters are sorted before lowercase by Unicode standards C. All letters are sorted before numbers by Unicode standards D. Special characters are sorted before letters by Unicode standards E. None of the above

B

What does the cd command stand for in Unix? A. command directory B. change directory C. control directory D. cancel directory E. none of the above

B

What does the command javac ClassName.java do in UNIX? A. Execute a java program. B. Compile a java program. C. Run a java program. D. Run a Python program. E. Print a java program.

B

What does the command mkdir do in UNIX? A. Change the directory B. Create a new directory C. List all files in the current directory D. Move a file to a different directory E. None of the above

B

What does the command of ls do in Unix? A. opens a file in a directory B. lists contents in a working directory C. lists file in a directory D. creates a directory E. none of the above

B

What happens when a Boolean expression is evaluated? A. the command loops B. it produces a value of true or false C. it calculates a value D. it is only evaluated if the condition is met E. none of the above

B

What is <relop> short for? A. conditional operator. B. relational operator. C. operator. D. reloop statement. E. None of the above.

B

What is a "nested loop" ? A. an infinite loop. B. a loop inside a loop. C. a boolean loop. D. a sentinel loop. E. all of the above.

B

What is a nested loop? A. A loop that resides towards the beginning of a program. B. A loop inside a loop. C. A loop that is separated from the rest of the program. D. All of the above. E. None of the above.

B

What is a sentinel loop? A. A loop that continuously sends values to functions. B. A loop that continues forever until a special value is entered, which ends the loop. C. A program that stands guard against viruses. D. A program that runs forever with no stopping. E. A loop that checks the other lines of a program for errors.

B

What is an event loop? A. a loop that handles input until a special input is required. B. program responds by processing an event. C. a loop pattern that asks the user whether to continue on each interaction. D. A loop structure that tests the loop condition after executing the loop body. E. Priming read is part of the pattern

B

What is an interactive loop? A. A loop that isn't controlled by the user. B. A loop that allows for portions of a program to be repeated according to the user. C. A loop that kills portions of a program according to the user. D. A loop that repeats a defined portion of a program according to the programmer. E. None of the Above.

B

What is it called when a loop has an exit in the middle of the body? A. Nested loop B. Loop and a half C. Pre-test loop D. while loop E. Post-test loop

B

What is one good use for the indefinite loop? A. while loop B. Interactive loop C. for D. elif E. sentinel loop

B

What is the body of an if statement? A. A collection of variables for use in the program. B. A sequence of one or more statements indented under the if statement. C. The condition of the if statement. D. A collection of further if statements. E. None of the above.

B

What is the body portion of a condition? A. The result of a conditional statement. B. Sequence of one more statement indented under the if heading. C. The list of possible answers of an if statement. D. The middle section of a boolean statement. E. None of the above.

B

What is used to represent the evaluations of Boolean variables? A. Test cases. B. Truth table. C. False table. D. Sign table. E. T-table.

B

What kind of exception handling does Python use? A. except-handle B. try-except C. try-else D. try-if-except E. none of the above

B

What loop style are modern graphics programs written in? A. Loop and a half B. Event loop C. Nested loop D. If elif loop E. None of the above

B

What sort of loop keeps iterating until certain conditions are met? A. Loop-dee-loop B. Indefinite C. Infinite D. Definite E. None of the above

B

What statement implements an indefinite loop? A. loop B. while C. if D. else E. all of the above

B

What statement is used to set a maximum value? A. max B. maxval C. maxvalue D. maximum E. top

B

What symbol or symbols are used to represent "equal to" A. = B. == C. === D. != E. =!

B

When a program is being run directly the value of the __name__ is? A. __Main__ B. __main__ C. main D. Main E. script

B

When we make a program simpler and easier to understand for users we call that making the program more: A. Usable B. Modular C. Progressive D. Methodical E. None of the above

B

When you are working with loops, how are you able to gain access to the loop? A. If it's in the code, you are able to access it. B. The statement must be true in order to gain access. C. Loops are always run, you don't need to gain access. D. You have to guess to figure out what you need to input, in order to gain access. E. You don't gain access, the loop does nothing special, just an organizational method.

B

Which Rational Operator refers to " equal to"? A. = B. == C. != D. >= E. <=

B

Which command allows you to move a file in Unix: A. mov B. mv C. move D. movefile E. None of the above

B

Which loop is a loop that handles input until a special value is encountered? A. Interactive loop. B. Sentinel loop. C. Infinite loop. D. End-of-file loop. E. None of the above.

B

Which of the following Unix commands will print the date in month/day/year format? A. date B. date +%D C. date +%F D. date +%G E. date +%M

B

Which of the following commands will give the user information about the UNIX command, who? A. manual who B. man who C. help who D. pwd who E. None of the Above

B

Which of the following is NOT a relational operator in Python? A. < B. =! C. == D. >= E. None of the Above

B

Which of the following is a binary operator? A. while B. or C. not D. True E. All of the above.

B

Which of the following is a sential loop? A. for n in range(11): <body> B. while userString != "": <body> C. if n >= 2: <body> D. if n == 2: <body>, else: <body> E. All of the Above

B

Which of the following is not an example of a relational operator in Python? A. < B. === C. >= D. != E. <=

B

Which of the following is the correct way to write a for loop? A. for <sequence> in <var>: <body> B. for <var> in <sequence>: <body> C. for <sequence>: <body> D. for <if <condition>>: <body> E. None of the Above

B

Which of the following python keywords allows you to test multiple conditions? A. or. B. and. C. elif D. try. E. else.

B

Which of these if statements are multi-way decisions? A. if B. if-elif-else C. else if D. if-else E. true-false

B

Which of these if statements are multi-way decisions? A. if B. if-elif-else C. if-else D. else if E. None of the Above

B

how to you draw text in a window? a) text1 = Text (Point (123, 123), "Example" text1 + draw(win) text1.setFill ("color") text1.setsize (10) b) text1 = Text (Point (123, 123), "Example" text1.draw(win) text1.setFill ("color") text1.setsize (10) c) text1 =+ Text (Point (123, 123) "Example" text1.draw(win) text1.setfill ("color") text1.setsize (10) d) Text1 = text (Point (123, 123), "Example" Text1.draw(win) Text1.setFill ("color") Text1.setsize (10)

B

A Boolean expression is one that returns values of: A. negative or positive B. greater than or less than C. true or false D. 0 and 1 E. None of the above

C

A Boolean expression is: A. Always True and False. B. Just True. C. Either True or False. D. Just False. E. Not all of the above.

C

A Python _____ statement is an example of an indefinite loop? A. print B. constant C. while D. staggered E. All of the above

C

A for loop is an example of what type of loop structure? A. Indefinite. B. Conditional. C. Definite D. End of file. E. None of the above.

C

A loop with the exit in the middle of the loop body is called: A. Early exit B. Mid exit C. Loop and a half D. Premature loop E. None of the above

C

A method used to avoid redundant testing of an algorithm is by using a A. trial and error approach B. redundant test approach C. decision tree approach D. multi processing approach E. none of the above

C

A sentinel loop continues to process data until reaching a what? A. answer B. break C. sentinel D. command E. None of the above.

C

According to the following program, which set of statements will be executed? x = -5 if x >= 0: print("Happy Halloween!") else: print("Merry Christmas!") A. Both statements will be executed. B. The if statement will be executed. C. The else statement will be executed. D. Neither statement will be executed. E. The program will not run and an error message will be printed.

C

An indefinite loop ends when... A. The value equals 0 B. The value equals 1 C. The condition is no longer met D. The condition is met E. At the end of the set amount

C

An operator that operates on single expression is called a: A. Unity operator B. Unify operator C. Unary operator D. Singular operator E. None of the above

C

Both "cmp" and "diff" commands are used for? A. windows B. Icon comparison C. file comparison D. menus E. All of the above

C

Conditions are actually a type of expressions called ____ , named after George Boole. A. Goorgie expressions. B. Boole expressions. C. Boolean expressions. D. Baboolean expressions. E. GooBoo expressions.

C

Decisions are based on the evaluation of? A. functions B. operators C. conditions D. algorithms E. mechanisms

C

Functions can be used for: A. Importing a library into your program B. Creating constructor statements C. Avoiding code duplication D. Making your program be able to use operators E. None of the above

C

How can you create a conditional program that will execute when run directly, but not when imported? A. Use a try statement to see if the special variable __name__ does not exist. If true, the program runs main(). B. Use an if statement to check the special variable __name__ and see if it equals the scripts name. If true, the program runs main(). C. Use an if statement to check the special variable __name__ and see if it equals __main__. If true, the program runs main(). D. Use a try statement to see if the special variable __name__ exists. If true, an except statement tells the program to run main(). E. None of the Above

C

How do you import graphics into python? a) from graphics import* b) graphics import * c) from graphics import * d) from graphics export *

C

How do you remove a non-empty directory named "cs125"? A. del cs125 B. rm cs125 C. rm -r cs125 D. del -r cs125 E. None of the Above

C

How to record terminal commands that appear on the screen? A. action B. record C. script D. execute E. write

C

If the condition is true, the while loop A. produces an error message. B. will stop. C. will keep going. D. will be skipped. E. pauses.

C

In GUI applications when a dialog box pops up and forces a user to interact to dismiss the dialog before using the application it is known as A. model dialog B. entry dialog C. modal dialog D. open dialog E. door dialog

C

In Unix to retrieve a 4 letter file that ends with p what do I use? A. search ???p B. search ***p C. echo ???p D. echo ***p E. ???p

C

In order to copy a file to a new directory, the __ command must be used. A. mv B. cd C. cp D. rm E. None of the above.

C

Indefinite loops are good for writing? A. variables B. iterations C. interactive loops D. loops E. All of the above

C

Mathematical concepts like " less than" or "equal to" are known as what in python? A. Operators. B. Mathematical operators. C. Rational Operators. D. Imaginary Operators. E. None of the above.

C

Statements that allow a program to execute different sequences of instructions for different cases are known as A. control structures B. choose structures C. decision structures D. flow structures E. none of the above

C

The best loop to use for a number-averaging problem is? A. Definite loop B. Pre-test loops C. Sentinel loop D. Interactive loops E. All of the above

C

The command that allows you to record what appears on the screen is called a what? A. record B. recordscreen C. script D. scriptscreen E. recorder

C

The for loop is a ______ loop? A. constant B. continuous C. definite D. staggered E. All of the above

C

What are the three Boolean operations? A. And, or , no. B. And, not, both. C. And, or, not. D. No, or, both. E. Any of the above.

C

What can be done to escape an infinite loop? A. Type "stop." B. Press Control-q C. Press Control-c D. Press Control-d E. Press enter.

C

What can happen if the condition of a while loop is not changed at all within the loop when it repeats? A. The program will continue forward without looping. B. The program will crash. C. The program will get stuck in an infinite loop and never end. D. The program will immediately stop and print out an error message. E. The entire computer will explode.

C

What causes an indefinite loop? A. The loop can never be entered. B. The condition to exit or ask for another input is met, so it continues to repeat the loop. C. The condition to exit or ask for another input is never met, so it continues to repeat the loop. D. You must guess the input that it is looking for in order to stop it. E. No conditions are created within the loop.

C

What command allows the change the base of a number on unix? A. change.base B. ch.base C. obase D. abase E. chbase

C

What command can be put before any other command to get information on that command? A. ls B. mkdir C. man D. hostname E. clear

C

What does "nesting" mean in the Python language? A. combining strings and numbers. B. doing a concatenation using plus signs. C. putting one compound statement inside another. D. multiplication or repetition. E. none of the above.

C

What does lexicographic ordering entail? A. Strings are put in alphabetical order according to only the first Unicode value of the string B. Strings are put in alphabetical order according to only the first letter C. Strings are put in alphabetical order according to the underlying Unicode values of the string D. Strings are put in order from Z to A according to the underlying Unicode values of the string E. Strings are put in order from Z to A according to only the first Unicode value of the string

C

What does the "man ls" function do? A. Ask the male creator of the program the question that follows the function. B. Searches the manual for the following inquiry. C. Brings up the whole manual. D. Pulls up all the files saved on the computer. E. None of the above.

C

What happens when the condition of a simple decision structure is false? A. The body text is executed normally. B. A syntax error occurs. C. The body text is skipped. D. The program completely stops. E. All of the above

C

What is a "priming read?" A. Reading the last number outside of a loop before carrying it out B. Reading the second number outside of a loop before carrying it out C. Reading the first number outside of a loop before carrying it out D. Python checking your loop for any errors before the program runs E. Python specifically running your loop as a separate program

C

What is a relational operator in Python? A. Determines the relationships between two variables. B. <relop> C. Just a fancy name for the mathematical concepts like "less than" or "equal to". D. Just an extra word placed in front of operator, to mean math concept. E. Refers to any of the math concepts within Python.

C

What is input validation? A. The program checks to make sure the input is a positive number B. The program checks to make sure the input is a string C. The program reprompts until the user enters a valid value for the input D. The program reprompts until the user enters an invalid value for the input E. None of the Above

C

What is the UNIX command to make a new directory ? A. "mkdir direct_name" B. "mikdr directory_name" C. "mkdir directory_name" D. "mkdir directory-name" E. All of the above

C

What is the command to find today's date? A. The "current_date" command B. The "chgrp" command C. The "date" command D. The "ps -ef" command E. All of the above

C

What is the correct string to draw a polygon? a) object = Poly (Point(point (123,123)) b) object = polygon (Point(point (123,123)) c) object = Polygon (Point(point (123,123)) d) object = Polygon (Point(point (123,123)

C

What is the easiest way to read lines from a file at a time? A. using a text document. B. using ReadAPP. C. using for line in infile. D. using Python_4.5. E. none of the above.

C

What is the term for when an input is completely wrong and there is a stop in the program for it? A. multi-way decision B. decision tree C. an exception handler D. false statement E. error statement

C

What kind of loop continues to process data until reaching a special value that signals the end? A. conditional loop B. indirect loop C. sentinel loop D. direct loop E. moderate loop

C

What statement is used for multi-way decision programs? A. if statements B. if-else statements C. if-elif-else statements D. while statements E. None of the above

C

What type of loop is a for loop? A. Indefinite that goes until a condition is met B. Definite and multi-way decision based C. Definite that iterates through a sequence D. Definite and makes a two way decision E. None of the above

C

When a module is imported, Python creates a special variable and assigns it a string representing the module's name, the variable looks like which of the following? A. _name_ B. _variable_ C. __name__ D. __.name.__ E. _-_name_-_

C

When using a flow chart, what do the diamond "boxes" represent? A. Outcomes. B. Values. C. Conditional Decisions. D. Inputs. E. Decisions.

C

When you are in the terminal/command prompt, how do you get information about a UNIX command? A. man = [command] B. man -[command] C. man [command] D. man[command] E. [command]-man

C

When you first open Unix, "<username>~" is followed by which symbol to indicate that it's ready for a command: A. % B. * C. $ D. @ E. None of the above

C

Which command list contents of working directory? A. ls DirName B. ls -l DirName C. ls D. ls -a DirName E. rmdir DirName

C

Which expression is short for relational operator? A. <rel> B. <ro> C. <relop> D. <relat> E. <relot>

C

Which of the following always makes a multi-way decision? A. if B. else C. elif D. try E. none of the above

C

Which of the following is not a relational operator A. > B. <= C. = D. != E. ==

C

Which of the following will result in giving the user information about a command? A. ls B. info C. man Command D. maninfo E. none of the above

C

Which statement is used to say when not to do one thing do another? A. if B. then C. else D. elif E. instead

C

A Python ___ loop is a definite loop that iterates through a sequence? A. interactive B. conditional C. modal D. for E. All of the above

D

A loop that never terminates is called? A. Indefinite. B. Busy. C. Tight. D. Infinite. E. None of the above.

D

A multiple choice question is most similar to ? a.) decision b.) an exception handler c.) two-way decision d.) multi-way decision e.) simple decision

D

After the "if" and before the colon, in an "if" statement, is the A. statement. B. decision. C. body. D. condition. E. definition.

D

An empty string is represented in python as? A. $ B. !! C. (): D. "" E. All of the above

D

For a program that has over two decisions, what order of commands would you use? A. If first, then else, then else. B. If first, then elif, then elif. C. If first, then not, then not. D. If first, then elif, then else. E. If first, then else, then elif.

D

How to edit a file ? a.) script b.) java ClassName c.) javac ClassName.java d.) emacs FileName e.) None of the above

D

How to read the user manual for each command in the terminal? A. read <command> B. help <command> C. info <command> D. man <command> E. explain <command>

D

How to remove a file? a.) rm DirName b.) clear c.) rm d.) rm FileName e.) All of the above

D

If a hyphen follows the "cd" command, what does it tell the Terminal to do ? A. Pull up all the files in that directory. B. Removes the directory entirely. C. Brings the user back to the directory right above the one they are currently in. D. Brings the user back the last directory they were in before they used the "cd" command. E. The hyphen does not mean anything for the "cd" command.

D

If the program: def main(): n = 5 while n != 6: n -= 1 print(n) main() is ran what would happen? A. Program will repeat until it reaches the value of 5 B. Program will repeat until it reaches the value of 1 C. Program will repeat until it reaches the value of 6 D. Program will never stop repeating E. Program will print "n"

D

In Python, what does = indicate, and what does == indicate? A. = indicates equality, == indicates an assignment statement. B. They both mean the same thing, similar to '' and "" meaning the same thing. C. = indicates an assignment statement, == indicates no equal to. D. = indicates an assignment statement, == indicates equality. E. None of the above

D

Python modules that are designed to be imported and used by other programs are called A. .py files B. scripts C. imported files D. libraries E. none of the above

D

The Counted Loop pattern uses a? A. post-test loop B. pre-test loop C. infinite loop D. definite loop E. loop and a half

D

The chmod command duty is? A. To order a line of variables B. Change ownership of the file C. Change group of the file D. Change the permission set of the file E. All of the above

D

The literals for type bool are? a.) T, F b.) True, False c.) 1,0 d.) true,false e.) All of the above

D

The loop variable ____ takes on each successive value in the sequence? A. Independent variable B. Portability variable C. Multi-user operations variable D. var E. All of the above

D

The main purpose of man within unix is A. over power any internal setting B. View files in a directory C. Easily manage directories D. display the user manual of any command that we can run on the terminal E. all of the above

D

The number/numbers in between the parentheses of range() determines... A. The value that the range is being found for B. An amount the range will be multiplied by C. A set of numbers that the range will be determined for D. The length that the program will find range in-between E. None of the above

D

The term for an operator that may not evaluate one of its subexpressions? A. faulty B. infinite C. exclusive D. short Circuit E. None of the above

D

The term for using a loop within another loop is _____. A. Combining B. Sequencing C. Verifying D. Nesting E. All of the above.

D

This question is most like what kind of scenario? A. simple descision B. primary decision C. two-way decision D. multi-way descision E. an exception handler

D

To exit manual pages what key do you click? A. Enter B. Esc C. Tab D. Q E. H

D

To find the remainder of 2 expressions what command do you use A. expr \\ expr B. expr // expr C. expr / expr D. expr % expr E. expr %% expr

D

To learn more about a function inside of Unix what command do you use? A. learn B. learn <hostname> C. man D. man <hostname> E. <hostname> man

D

To make a new directory in Unix you use which command: A. makedir B. dirmake C. dirmk D. mkdir E. None of the above

D

Using the rules of Algebra, what is the correct way to write a + 0 = a in Boolean Algebra? A. a and b == c B. a and false == false C. a and true == a D. a or false == a E. None of the above

D

What Python modules are designed to be imported and used by other modules? A. Programs B. Scripts C. Strings D. Libraries E. All of the above

D

What are the names of statements used for a multi-way decision? A. if-elif B. if-while-else C. try-except D. if-elif-else E. if-except

D

What command allows you to print a working directory? A. print B. pd C. print directory D. pwd E. printd

D

What command deletes a file within a directory? A. dele B. era C. wipe D. rm E. None of the above.

D

What command is used to run a python program? A. python B. runpython C. python2 D. python3 E. ```python

D

What command prints your working directory? A. wrkdirc B. dirc C. Pwd D. pwd E. dirc-pwd

D

What do you use to make a string span multiple lines? a) " b) ' c) """ d) \

D

What does the typescrpit command do? a) type out the word script b) type out the word typescript c) screen records what you type d) just records the text you put in and the output you get

D

What is Tkinter A. A library that must be imported manually in Python B. A type of expression in Python. C. The name of the command prompt that Python uses. D. Default GUI interface that comes with Python. E. The component that helps decrease memory usage in Python.

D

What is a Python while loop? A. A definite loop that iterates through a sequence. B. An indefinite loop that doesn't iterate through a sequence. C. A definite loop that doesn't iterate through a sequence. D. An indefinite loop that continues to iterate for as long as the loop conditions are true. E. All of the above.

D

What is the correct order of using who | sort on the following active usernames: wilkesuni, compsci, koch, mathcs A. wilkesuni, mathcs, koch, compsci B. compsci, koch, wilkesuni, mathcs C. koch, mathcs, wilkesuni, compsci D. compsci, koch, mathcs, wilkesuni E. None of the above

D

What is the difference between a library and a program/script in Python? A. Libraries are past programs/scripts. B. A library is a program that someone else wrote to use in a personal program/script. C. Libraries are run directly, while programs/scripts are meant to be imported. D. Programs/scripts are run directly, while libraries are meant to be imported. E. Programs/scripts is anything written in Python.

D

What is the difference between the prefixes "mk" and "rm"? A. "Mk" is the command for the manual and "rm" is for the specific directory. B. "Mk" is to move a file and "rm" is to remove a file or directory. C. "Mk" is to make a file or directory and "rm" is to copy a file. D. "Mk" is to make a file or directory and "rm" is to remove a file or directory. E. None of the above.

D

What is the easiest way to read lines from a file one line at a time? A. while line != "": B. for infile in line: C. while line == "": D. for line in infile: E. There is no way to read lines from a file one line at a time in Python.

D

What is the ordering when comparing strings? A. pythongraphic B. unixgraphic C. softgraphic D. lexicographic E. compgraphic

D

What is the output of the following code: >>> list = ([1, 2, 3], [4, 5, 6]) >>> print(list[1][1]) A. 1 B. 2 C. 4 D. 5 E. 6

D

What is the part of the program that creates a function? A. function constitution. B. function name. C. function description. D. function definition. E. function modification.

D

What is the result of this example interaction: >>> "Computer" < "computer" A. Error B. true C. false D. True E. no

D

What is the term for a loop where the exit is in the middle of the loop body? A. Indefinite. B. Definite. C. Conditional. D. Loop and a half. E. None of the above.

D

What is the variable "house" used as in this line of code? def deliver(house) A. A library. B. A file. C. A program. D. A parameter. E. A function.

D

What is true about Boolean algebra? A. a and false == true B. a and true == b C. a or false == ! D. a or false == a E. none of the above.

D

What literals represent Boolean values? A. Yes and no. B. And and not. C. Or and not. D. True and false. E. Boolean values are numbers.

D

What statement causes a loop to end? A. break B. quit C. stop D. exit E. false

D

What statement will indicate the usage of a "loop and a half?" A. quit() B. end() C. while D. break E. if

D

What statements are used to handle exceptions in Python? A. try...accept B. try...handle C. try...catch D. try...except E. try...correct

D

What type of loop continues until a certain condition is met? A. if loops B. if else loops C. if elif else loops D. while loops E. None of the above

D

What will be the output of the statement max("Four", "4", "Five", "5")? A. '4'. B. 'Five'. C. '5'. D. 'Four'. E. TypeError.

D

What would the command "man bc" do in Unix: A. Make bc local B. Open bc's folder location C. Move bc D. Pull up the manual for bc E. None of the above

D

When navigating through directories, what command exits the current one to go "up" a directory? A. cp . B. cp . . C. cd . D. cd . . E. cd up

D

When the first item is retrieved before the loop starts it is called A. proof read B. base read C. first read D. prime read E. all of the above

D

Which is Python's exception handling mechanisms? A. try B. except C. If-else D. try-except E. All of the Above

D

Which is not a strategy when presented with a decision problem? A. Compare each to all B. Decision tree C. Sequential processing D. Step by step processing E. All of the above

D

Which of the following Boolean expressions will run without error(s): I. while input[1] == "x" or input[1] == "X": II. while input[1] == "x" or "X": A. Both will run without errors. B. Neither will run without errors. C. Only II. will run without errors. D. Only I. will run without errors. E. Neither I. or II. are Boolean expressions.

D

Which of the following is defined as a statement that allows a program to execute different sequences of instructions for different cases? A. Boolean Expressions. B. Compound Conditions. C. Control Structures D. Decision Structures. E. None of the above.

D

Which of the following loops will keep iterating until certain conditions are met? A. definite loop B. interactive loop C. validation loop D. indefinitely loop E. none of the above

D

Which of these is the term used to describe the parts of a program in which the user is in control of how to interact? A. Modal. B. Bimodal. C. Not modal. D. Nonmodal. E. Quasimodal.

D

Within a sentinel loop, what is the value called that ends the loop? A. Actual data value B. Argument C. Variable D. Sentinel E. Condition

D

elif is used in what type of decisions? A. One way decisions B. Two way decisions C. Zero way decision D. Multi way decisions E. All of the above

D

what does math.pi do? a) imports pythons built-in math functions. b) returns random numbers. c) returns an infinite number. d) returns the value of Pi.

D

How can you call a function that is defined as pizza? A. pizza: B. (pizza) C. callpizza() D. "pizza"() E. pizza()

E

How do you break an infinite loop? A. cd. B. Typing "stop". C. Control X. D. Escape. E. Control -c.

E

How do you create a directory in UNIX? A. man -k Topic B. man command C. cd DirName D. cd E. None of the above

E

How do you display files and the name of the user which owns them? A. Using ls -a command B. Using ls command C. Using cp command D. Using pwd command E. Using ls -l command

E

How do you remove a non-empty directory in UNIX? A. rmdir [DirName] B. rmv [DirName] C. rmdir = [DirName] D. rmv -r [DirName] E. rm -r [DirName]

E

How to do an if-else statement in Python? A. else if B. if else C. ifel D. if-else E. elif

E

How to get information about the UNIX command? a.) ls b.) cd c.) man d.) command e.) man Command

E

If a user types an incorrect value into a program, the program will ask for another value. What is the name of this process? A. input check B. validation check C. system check D. event check E. none of the above

E

In python conditions not equal to is written as? a.) none b.) =! c.) =/ d.) /= e.) !=

E

In python, the expression True + True + True will evaluate to which of the following outputs? A. TrueTrueTrue. B. 0. C. True True True. D. False. E. 3.

E

Putting one compound statement inside another is called: A. Overlap B. Combination. C. Insertion. D. Procrastination. E. Nesting.

E

The command cd does what in UNIX? A. List contents of the current directory B. Change the directory into one in the current directory C. Clear the screen D. Copy a file in the current directory E. None of the above

E

The elif statement stands for: A. eliminate if B. elaborate if C. enumerate if D. elongate if E. None of the above

E

To read the first 10 lines of a file what command would be most effective? A. front B. front 10 C. head 10 D. head -10 E. head

E

Using DeMorgan's Law, we can convert the complex statement "not(ch >= 'a' and ch <= 'z')" into a simpler statement by distributing a unary operator. Which of the following statements is simplified? A. not(ch < 'a' or ch > 'z') B. (ch < 'a' and ch > 'z') C. (ch >= 'a' or ch <= 'z') D. not(ch < 'a' and ch > 'z') E. (ch < 'a' or ch > 'z')

E

What UNIX command will bring the user to the previous directory before the last time cd was issued? A. cd ~ B. cd .. C. cd // D. cd back E. cd -

E

What are some commands in UNIX? A. man command B. pwd C. clear D. script E. All of the above

E

What are some relational operators in mathematics? A. <= B. != C. >= D. == E. None of the above

E

What are some relational operators in python? A. < B. <= C. == D. >= E. All of the above

E

What are the different file types available with UNIX? A. Regular files, Directory files and Character special files B. Block special files C. FIFO D. Symbolic links and Sockets E. All of the above

E

What are the uses of loops? A. Reading a file. B. Traversing a list, or string, or array. C. Repeatedly executing a condition. D. Shortens repetitive typing. E. All of the Above.

E

What command will change the working directory to home directory? A. chdir B. ch C. change D. man chdir E. none of the above

E

What does the break statement do? A. Does not allow for the program to be run again. B. A way to just close the program window. C. Fixes programming errors D. Breaks the program E Causes the loop to immediately close.

E

What does the try...except statement allow us to do? A. Create a program with many errors within it. B. Suggests you to try certain variables, some are correct others are not. C. Allows you to guess what values are not permitted to be used. D. Try all values except for ones listed. E Write bullet-proof programs.

E

What is a loop called when the exit is in the middle of the body? A. Sentinel loop B. Interactive loop C. Infinite loop D. end-of-file loop E. Loop and a half

E

What is a sentinel? A. A loop that continues to process data until reaching a specific signal that ends the loop. B. A type of infinite loop. C. A value that signifies the end of the loop after it is processed. D. An interactive value for an infinite loop. E. A distinct value that signifies the end of the loop before it is processed.

E

What is an indefinite loop? A. A loop that is not exact. B. A loop that is not sure what it is doing. C. A nested loop. D. Not really a loop. E. A loop implemented when using the while statement.

E

What is not one of the four-steps processes when Python comes to a function call? A. the calling program suspends execution at the point of the call. B. the formal parameters of the function get assigned the values supplied by the actual parameters in the call. C. the body of the function is executed. D. control returns to the point just after where the function was called. E. the file called graphics.py must be imported at the end of the program.

E

What is the command to copy a file from the desktop? A. "Cd". B. "Mv". C. "Mkdir". D. "ls". E. "Cp".

E

What is the error with the following code: n = 10 i = 6 while i < n: print(i) A. i should be 0 B. n should be less than i C. There should be an exception for the while loop adding 1 to i D. The while loop should be an if statement E. After print, there should be a definition of i where it is increased by 1, otherwise it will be a sentinel loop

E

What is the purpose of a try statement? A. It will carry out the entire program without error B. It will only carry out the function you put the statement in C. It will rewrite your code to carry out the purpose of the function better D. It will fix any errors in your code E. It will test your code for errors

E

What is the result of this example interaction: >>> def hello(): print("Hello, I will pass this class") >>> hello() A. Hello. B. print("Hello, I will pass this class") C. "Hello, I will pass this class") D. print("Hello, I will pass this class" E. Hello, I will pass this class

E

What is true about conditions? A. conditions may compare either number or strings. B. strings are in alphabetical order according to the underlying Unicode values. C. all uppercase Latin letters come before lowercase equivalents. D. when comparing strings, the ordering is lexicographic. E. all of the above.

E

What kind of statement is used to avoid nesting if-else structures? A. else. B. if. C. try. D. except. E. elif.

E

What point can you expand on simple conditions? A. when the condition thinks it's right B. when the expression is false C. when the expression makes sense D. when the expression does not make sense E. when the expression is true

E

What type of statement is used to implement a decision? A. A What statement. B. A When statement. C. A Who statement. D. A Where statement. E. An If statement.

E

Which of the following is a Boolean operator? A. for B. of C. the D. if E. and

E

Which of the following is a feature(S) of UNIX? A. Machine independent B. Portability C. Multi-user operations D. Pipes and filters E. All of the above

E

Which of the following is a mechanism that catches and deals with errors as the program is running? A. Nesting. B. Sequential Processing. C. Decision Trees. D. Multi-Way Decisions. E. Exception Handling.

E

Which of the following is an advantage of using a command line to delete files? A. Multiple files can be deleted quickly. B. Files can be removed from the Trash if errors are encountered. C. You can delete files that are hidden in the Finder. D. If the Finder is not able to be accessed, the user may be able to solve the problem using the command line. E. All of the above.

E

Which of the following lists ALL of the Boolean operators? A. and, or, not, either B. and, not, C. and, or D. and, or, not, next E. and, or, not

E

Which of the following relational operators means "greater than or equal to"? A. < B. > C. != D. <= E. >=

E

Which of these Unix commands can be used to quickly change the name of a file? A. rnm B. nm C. rm D. pwd E. mv

E

Which statement is an example of an indefinite loop? A. If. B. If-else. C. If-else-elif. D. When. E. Where.

E

You can view "invisible files" by typing A. ls -A B. ls -l C. ls -i D. ls E. ls -a

E

What are the responsibilities of a shell? A. Program execution and Input/output redirection B. Filename and variable substitution C. Pipeline hookup and Environment control D. Integrated programming language

idk lol

Functions communicate information back to the caller through: A. Return values B. Output C. Variables D. parameters E. None of the above

A

What does range do? a) returns a sequence of numbers starting at 0 and stops at a number you set. b) sorts your strings numbers. c) returns the average of user input numbers. d) return the average of string numbers.

A

What is an example of a two way decision? A. if else B. if-elif-else C. if-elif else D. if elif-else E. None of the above

A (Person had B but that's wrong)

How do you close out of an information window for a Unix command? A. Typing 'quit' B. Press the 'q' key C. Press the 'esc' key D. Press control and 'q' keys E. Closing the entire terminal window

B

How do you enter a Manual on unix? A. <command> man B. man <command> C. manual <command> D. <command> mannual E. none of the above

B

How do you exit a manual on Unix? A. Press "Esc" B. Press "q" C. Press "Ctrl + d" D. Press "C E. Press

B

How do you record what appears on the screen? A. ls B. script C. pwd D. rm E. none of the above

B

How to copy a file? a.) script b.) None c.) pwd d.) clear e.) mv

B

How to see who is running on Dilbert in the terminal? A. whoami B. who C. where D. what E. people

B

If your function is printing "None" in the output you should check that: A. You imported the function library B. You didn't miss a return statement in your function C. You didn't make a syntax error D. You ended the file name with .py E. None of the above

B

In all if-elif-else decision structures, how many statements will be executed? A. zero B. one C. two D. three E. all of them

B

Lexigraphic ordering sorts by A. ASCII values. B. Unicode. C. Alphabetizing. D. String length. E. None of the above.

B

Placing a decision inside of another decision is indicated by? a.) parentheses b.) indentation c.) curly braces d.) a colon e.) None of the above

B

The main use of defining multiple functions in one program is A. To have multiple starting points for your program in case one fails. B. To break down one large function into multiple smaller pieces. C. To run two or more programs at the same time. D. To combine multiple smaller programs into one large program. E. To confuse every student who reads it.

B

To make previous commands and characters out of sight in Unix we use which command: A. rm B. clear C. quit D. clean E. None of the above

B

To read the description for a command, what command should be used with it? A. mul B. man C. mot D. mef E. None of the above.

B

Using a while loop, the loop will keep going as long as? A. The condition is false B. The condition is true C. The condition is less than zero D. The condition is greater than zero E. None of the above

B

What kind of expression is a condition? A. complex. B. Boolean. C. simple. D. one-way. E. two-way.

B

How do you exit a cat or a script? A. Esc B. Ctrl + Esc C. Ctrl + d D. Ctrl + p E. Ctrl + q

C

To display the files within a directory, what command should be used? A. dis B. show C. ls D. wir E. None of the above.

C

To show an entire text file (for example: unix.txt) in the terminal, what command should you use? A. cat. unix.txt B. cat > unix.txt C. cat unix.txt D. mk unix.txt E. rm unix.txt

C

Two-way decisions can be implemented by attaching an ____ clause onto an if clause. A. extra. B. second. C. else. D. other. E. None of the above.

C

Up to how many lines will the "head" command print? A. 3 B. 5 C. 10 D. 12 E. 15

C

What are all the relational operators that conditions are formed? A. = B. <, >, and = C. <, <=, !=, ==, >, and >=. D. =, !=, and ==. E. None of the Above.

C

What are decision structures? A. Guides that assist in decision-making. B. Structures constructed by many decisions. C. Statements that allow a program to execute different sequences of instructions for different cases. D. A piece of code that is made up of many different inputs from a user. E. None of the above.

C

What command is used to see all files in a directory? A. ls B. cd C. ls -a D. man ls E. None of the above

C

What does Python return when a variable that has nothing in it is printed? A. "Empty" is printed. B. A blank space is printed. C. "None" is printed. D. A Syntax Error is displayed. E. All of the above

C

What is a sentinel loop. A. A loop that lets other loops handle input. B. A loop that handles input indefinitely. C. A loop that handles input until a special value is encountered. D. A loop that can't handle input. E. All of the Above.

C

What is a sentinel loop? A. continued loop pattern B. Definite loop C. a loop that handles input until a special input is required. D. uses a while loop E. boolean loop

C

What is an if-else statement an example of? A. multi-way decision B. an error C. two-way decision D. simple decision E. None of the above

C

What is another name for a conditional loop? A. definite loop B. develop loop C. indefinite loop D. indirect loop E. none of the above

C

What is called shell? A. The variable of the user and the system B. The interface of the user C. The interface between the user and the system D. The interface of the specific system E. All of the above

C

Multi-way decisions are implemented with: A. if-el-else B. elif-else-if C. if-else-elif D. if-elif-else E. if-elif-el

D

Using a loop and a half can avoid doing what? A. using a post-test loop B. using a boolean expression C. using a indefinite loop D. using a file loop E. using a sentinel loop

E

What is the first item that is retrieved before a loop starts? A. priming read B. pre-test read C. test statement D. variable E. All of the above

A

Which command clears text? A. clear B. .clear C. .remove D. remove E. cd

A

Which of the listed below is the structure of an if statement A. if <condition> <body> B. if <condition><body> C. if <body> <condition> D. if <body><condition> E. if <body> (<condition>)

A

Who created Boolean Algebra? A. George Boole B. Booley Einstein C. John Koch D. Ryan Boolean E. John Zelle

A

not is a _____ operator, as it operates on a single expression. A. unary B. binary C. trinary D. sole E. None of the above.

A

What starts a class definition? a) def b) class c)__init__ d) object

B

which line would not be found in a truth table for and? A. TTT B. FTF C. TFT D. FFF E. None of the above

B

The command that creates a directory is A. mkr B. mki C. mkdir D. mdi E. mkd

C

What is a Boolean expression? A. An expression that can only be done using an elif statement. B. A scary ghost that leans to the side. C. A conditional expression that concludes if the value is true or false. D. All of the above. E. None of the above.

C

What operator Python program uses to represent equality? A. = B. =! C. == D. <=> E. =+

C

What is a for loop also called? A. Infinite loop B. Regular loop C. Complicated loop D. Definite loop E. None of the above

D

Which of the following can be typed in addition to ls to list "invisible" files within a directory? A. -l B. -R C. -k D. -a E. -s

D

An if statement is a ______ decision. A. Two-way B. Complex C. Simple D. One-way E. Both C and D.

E

What statement can be executed in the body of a loop to cause it to terminate? A. return B. exit C. input D. if E. break

E

A loop pattern that continues until special value is input is called ? A. Sentinel loop B. interactive loop C. infinite loop D. end-of-file loop E. All of the above

A

At least how many times must a post-test loop execute the body of a loop? A. once B. twice C. three times D. four times E. as many as the programmer commands

A

At the end of a function, what line must be typed in order to send back a value to the main program? A. return <variable> B. bringback <variable> C. <variable> D. retrieve <variable> E. send <variable>

A

Continuing to reprompt an incorrect value until a correct one in inputted is called. A. Input validation B. Interactive loops C. Nested loops D. Decision structure E. All of the above

A

Else in if-else statements does what in Python? A. Executes a statement if none of the if conditions are true. B. Executes a statement if all of the if conditions are true. C. Keeps repeating the loop until a condition is met. D. Stops the loop unless a condition is met. E. None of the above.

A

Exception handling is for catching errors in the code, and is done with which of the following commands: A. try and except B. if and except C. try and unless D. do or do not, there is no try E. None of the above

A

GUI programs are generally... A. Event driven. B. Time driven. C. Input driven. D. Both B and C. E. All of the above.

A

How do you copy a file in Unix? A. cp OriginalName CopyName B. cp $OriginalName $Copyname C. cp CopyName OriginalName D. cp $CopyName $OriginalName E. none of the above

A

How to list the content of a working directory? a.) ls b.) cd c.) ls DirName d.) cd Dirname e.) None of the above

A

How to see hardware information in the terminal A. uname -p B. uname -o C. uname D. uname -n E. uname -r

A

Identify the missing command used to produce the final line in the following sequence: koch@dilbert:~$/cs125/labs/8$ ls typescript unix.out unix.txt koch@dilbert:~$/cs125/labs/8$ ls typescript unix.txt A. rm unix.out B. cat > unix.out C. rmdir unix.out D. mk unix.out E. emacs unix.out

A

In order to "pipe" a file, what symbol is used? A. | B. \ C. / D. = E. ~

A

One good use of the indefinite loop is to write ? A. interactive loops B. pre-test loops C. indefinite loops D. nested loops E. All of the above

A

Statements that allow a program to execute different sequences of instructions for different cases are known as A. decision structure B. chaos structure C. body structure D. flow structure E. none of the above

A

The ______ command views the top ten lines of a text file. A. head B. top C. begin D. tail E. None of the above.

A

The best structure for implementing a multi-way decision in python is? a.) if-elif-else b.) if c.) if-else d.) try e.) else

A

The chown command duty is? A. Change ownership of the file B. To a request for an object to perform one of its operations C. Change the permission set of the file D. Change group of the file E. All of the above

A

The man command allows you to do what? A. get information about a Unix command B. get information about a Python command C. get information about a file D. get information about a document E. all of the above

A

The statement while is a/an... A. Indefinite Loop B. Definite Loop C. Nested Loop D. File Loop E. Sentinel Loop

A

Things such as "<, >, =" etc. are called: A. relational operators B. mass operators C. comparative operators D. alligators and bridges E. None of the above

A

To avoid the redundant tests of the previous algorithm, we can use: A. A decision tree. B. Two-way decision. C. A sequential processing. D. A simple decision. E. Max of three.

A

To write a program that gives a warning for when temperature is equal to or over 90 how would you write it? A. if temp >= 90 else print("Warning") B. if temp >= 90 else print(Warning) C. if temp = 90 else print("Warning") D. if temp => 90 else print("Warning") E. if 90 >= temp else print("Warning")

A

Typing which of the following can result in successfully running a python program? A. python3 moduleName.py B. python3.launch C. cat > python3 D. run.fileName E. none of the above

A

What are Decision structures? A. Control structures that allow a program to execute different sequences of instructions for different cases. B. Control structures that do a specific thing. C. Instructions to control structures. D. A program reader. E. None of the above.

A

What are Decision structures? A. Control structures that allow a program to execute different sequences of instructions for different cases. B. Control structures that does a specific thing. C. Instructions to control structures. D. A program reader. E. None of the above.

A

What are file loops? A. When you type all of the numbers into a file. B. When the exit is in the middle of the body. C. Priming read is part of the pattern. D. A loop pattern that asks the user whether to continue on each interaction. E. A loop that handles input until a special input is required.

A

What are python modules that can be imported called? A. Libraries B. Settings C. Scripts D. Programs E. Extensions

A

What can be implemented to use a multi-way decision? A. if-elif-else B. if-else-elif C. try-except D. try-if D. none of the above

A

What code "exits" out of a while loop? A. break B. return C. end D. exit E. None of the above.

A

What do boolean statements represent? A. True and False B. Sum and Multiplication C. Conditions & Statements D. All of the above E. None of the above

A

What does Python look for after a try statement? A. an except clause B. an if statement C. a boolean expression D. a second try statement E. none of the above

A

What does lexicographic means when ordering strings? A. Strings are put into alphabetical order. B. loop. C. Strings lowercase letters comes before uppercase letters. D. Starts script E. Starts print

A

What does the "R" mean when it is after "rm"? A. It signals the Terminal to remove everything. B. It signals the Terminal to remove the file or directory that follows the command. C. It signals that the user of the Terminal is unsure if they want to remove the file or directory. D. It saves the file or directory instead of removing it. E. It marks the file for trash that will be disposed of later.

A

What error message do you receive when your program comes across a ValueError? A. ValueError: math domain error B. ValueError C. ValueError: unavailable value entered D. Incorrect input received E. DomainError: value error

A

What happens in a two-way decision? A. the inputs are fed through two expressions B. there are two inputs C. the computer makes two decisions D. the computer makes two outputs for you to decide on E. you have to decide on your own two inputs

A

What is a Python for loop? A. A definite loop that iterates through a sequence. B. An indefinite loop that doesn't iterate through a sequence. C. A definite loop that doesn't iterate through a sequence. D. A loop that repeats itself. E. All of the above.

A

What is a function in the python programming language? A. a small program inside a program. B. a print statement. C. a loop. D. a complicated concept to describe. E. none of the above.

A

What is a pattern that asks the user whether to continue on iteration? A. Interactive loop B. Infinite loop C. Sentinel loop D. end-of-file loop E. None of the above.

A

What is an indefinite loop? A. A loop that keeps iterating until certain conditions are met B. A loop that iterates a set amount of times determined when the loop starts C. A loop that is undefined under a certain set of conditions D. A loop that is always nested inside of an if statement E. All of the Above

A

What is python's standard precedence rules for Boolean operators, ordered from high to low? A. not, and, or. B. or, and, not. C. and, or, not. D. and, not, or. E. or, not, and.

A

What is the command "rm" purpose? A. Command for deleting files B. Command to delete directories and subdirectories with files within C. Change the permission set of the file D. Indicate all entires E. All of the above

A

What is the easiest way to read lines from a file one at a time? A. 'for line in infile' B. 'for every line in the file' C. 'while every line in the file' D. 'if line = infile' E. 'infile = line'

A

What is the output of the command "head test.txt | sort" if test.txt has the following in it: 10 & Hello A. & 10 Hello B. 10 & Hello C. Hello & 10 D. Hello 10 & E. 10 Hello &

A

What is the processed called when a loop keeps asking for an input until it receives a valid value? A. Input validation B. Validation C. Input accuracy D. Actual data value E. Reprompting

A

What is the result of the following condition? >>> "John" < "bob" A. True B. False C. SyntaxError D. ValueError E. NameError

A

What is the result of this example interaction: >>> bool("hi") A. True B. true C. false D. False E. error

A

What is the terminal, based on the desktop environment that is used on Dilbert, called? A. MATE Terminal B. Konsole C. GNOME Terminal D. Xterm E. UXterm

A

What is wrong with the following code? color = input("Enter a color name: ") if color = 'green': print("green is a lovely color!") A. The if statement operand should be ==, not just = B. The definition of color should use ==, not = C. There shouldn't be quotations around green D. The print statement doesn't need quotations E. The if statement should actually be a while loop

A

What parameters do you need to draw a graph? a) GraphWin, winWidth, WinHeight b) graphwin, winwidth, winheight c) GraphWin winWidth WinHeight d) GraphWin, winWidth, winHeight, winDepth

A

What process askes to continue on each itteration? A. interactive loop B. sentinel loop C. end-of-file loop D. infinite loop E. none of the above

A

When a loop continues creating output without an end that is called which sort of loop? A. Infinite loop B. Endless loop C. Repeating Loop D. Indefinite E. None of the above

A

When attempting to get into your CS125 directory for Home, what command do you use? A. cd cs125 B. ac cs125 C. dc cs125 D. cs ~ E. cd ~

A

Which execution will cause Python to end immediately? A. break B. _break C. end D. pressing command q E. any of the above will work

A

Which is not a true statement about UNIX? A. UNIX commands are not case sensitive B. You press "q" to leave the man pages of a command C. UNIX commands are case sensitive D. Clearing the terminal/command prompt window is as easy as typing "clear". E. You type "quit" to leave the man pages of a command

A

Which key can be used to scroll back a page when viewing a manual file? A. b. B. r. C. q. D. Spacebar. E. Return/Enter.

A

Which loop is an interactive loop that allows portions of a program to be repeated according to the wishes of the user? A. Interactive loop. B. Sentinel loop. C. Infinite loop. D. End-of-file loop. E. None of the above.

A

Which of the following are the dedicated literals for the bool data type in Python? A. True, False B. Yes, No C. 0, 1 D. Positive, Negative E. All of the Above

A

Which of the following commands will start to record the terminal window A. script B. record C. typescript D. scriptstart E. script -start

A

Which of the following is a relational operator? A. ==. B. =. C. ++. D. ^. E. None of the above.

A

Which of the following will create a directory named "testdirectory" and list all hidden files in said directory? A. mkdir testdirectory, ls -a testdirectory B. makedir testdirectory, ls C. mkdir testdirectory, ls -a D. mkdir testdirectory, ls -l testdirectory E. mkdir- testdirectory, ls -a testdirectory

A

Which of these are for a two-way decision programming pattern? A. if-else statement B. if statement C. if-elif-else statement D. try-except statement E. None of the Above.

A

Which value would end a sentinal loop A. -67 B. 0 C. 1 D. 14 E. 32

A

what does cp -R do in Unix? A. copies every item in the folder to the new location B. deletes every item in the folder C. copies only certain files in the folder to the new location D. copies the current file to the new location E. none of the above

A


Conjuntos de estudio relacionados

Clinical and Counseling Psychology Exam #1

View Set

Psychology Exam (Practice Test): 3

View Set

Biochemistry II Chapter 9 Lipids Practice Questions/MC

View Set

NURS 3005 Concepts - Exam 1 Review

View Set

Ch. 20: The Foreign Corrupt Practices Act (FCPA)

View Set

NUAS240T - Chapter 19 - Nursing Management of Pregnancy at Risk: Pregnancy-Related Complications

View Set