click below
click below
Normal Size Small Size show me how
Comp. Sci. - Python
Quizzes 1 - 5
Question | Answer |
---|---|
Identify the three components of effective computer science (one-word answers) | Understanding Knowledge Ability |
Define a loop | A portion of an algorithm that is repeated |
Define algorithm | A sequence of unambiguous instructions for solving a problem in a finite number of steps |
Define programming language | A system of notation for writing algorithms that solve problems in a form that a computer can process |
Define computer science (not on quiz, but extra) | the study of algorithms, the related mathematics, and their applications to practical computational problems |
What kind of programming is illustrated by this instruction? ADD @2, @1, @3 | Assembly Language |
What do we a call a program that simulates a computer whose machine language is a high-level language? | Interpreter |
Write a Python statement that prints the name of the university we attend on the screen | print("Lipscomb University") |
Write a Python statement that prompts the user to enter his or her GPA and then assigns the resulting floating-point number to a variable called 'gpa' (Answers will vary. just know how to do this) | gpa = float(input("Please enter your GPA: ")) |
There is a technique for designing a program in which you begin with a very abstract statement of an algorithm and work through a series of refinements providing more detail. What do we call this technique for designing a program? (two-word answers) | Step-wise Refinement OR Top-Down Design |
The main algorithm for most programs comprises three very abstract steps. What are they? (one-word answers) | Input Compute OR Process (either are acceptable) Output |
Write a Boolean expression to express this condition: The variable 'bison' is greater than both the variables 'purple' and 'gold'. | bison > purple and bison > gold |
Let the variables 'gold' and 'purple' have the values of 12 and 45 respectively. Show the value of each of these expressions. a. gold != 12 or not(purple <= 18) b. not (gold <= 10 and purple > 40) | a. True b. False If you want to see how, email me. jjardor@mail.lipscomb.edu |
Make a truth table for the Boolean or operator (not in table form, but is true) | True or True → True True or False → True False or True → True False or False → False |
List the six relational operators in their correct Python form | > >= < <= = != |
List the six phases of development, in order. | Requirement Design Implementation Testing Deployment Maintenance |
Let 'music', 'city', and 'nashville' be variables in a program. Write an assignment statement that assigns the sum of 'music' and 'city' to 'nashville' | nashville = music + city |
What is the value of 'bison' after these statements are executed? bison = 24 bison = bison // 7 | 3 |
If we assume the variable 'purple' = 5 and the variable 'gold' = 2, what value will the variable 'bison' have after this statement is executed? bison = 6 // (purple-gold) * purple + 3 | 13 |