FOP Chapter 1 & 2 Test - PDF

Summary

This is a past paper, containing multiple choice questions on various concepts related to algorithms and programming, especially focused on the fundamentals of programming concepts like algorithms, input/output devices, and the Python programming language. The questions deal with identification of input/output devices, the functions of programming languages like Python as well as basic programming concepts and syntax.

Full Transcript

Name: ________________________ Class: ___________________ Date: __________ ID: A FOP Chapter 1 & 2 Multiple Choice Identify the choice that best completes the statement or answers the question. ____ 1. Which of the following are examples of algorithms?...

Name: ________________________ Class: ___________________ Date: __________ ID: A FOP Chapter 1 & 2 Multiple Choice Identify the choice that best completes the statement or answers the question. ____ 1. Which of the following are examples of algorithms? a. A dictionary c. A set of instructions to put together a shed b. A recipe d. A spell checker of a word processor ____ 2. Which of the following are input devices? a. Speaker c. Printer b. Microphone d. A Monitor ____ 3. Which of the following are output devices? a. A keyboard c. A monitor b. A flatbed scanner d. Your hand ____ 4. Which of the following translates and executes instructions in a programming language? a. A compiler c. A loader b. A text editor d. An interpreter ____ 5. Which of the following outputs data in a Python program? a. input() c. print() b. the assignment statement d. display() ____ 6. What is the set of rules for forming sentences in a language called? a. Semantics c. Syntax b. Pragmatics d. Logic ____ 7. The result of 10**2 is ? a. 20 c. 1000 b. 5 d. 100 ____ 8. The result of 7 // 12 ? a. 7 c. 1 b. 0 d. Syntax error ____ 9. The result of the expression 3 * 4 ** 2 ? a. 48 c. 144 b. 24 d. 72 1 Name: ________________________ ID: A ____ 10. What must you use to create a multi-line string? a. A single pair of double quotation marks c. A single pair of three consecutive double quotation marks b. A single pair of double quotation mark d. Embedded newline characters ____ 11. What is used to begin an end-of-line comment? a. / symbol c. % symbol b. # symbol d. /* symbol ____ 12. The expression round(23.67) evaluates to which of the following values? a. 23 c. 23.67 b. 23.6 d. 24 ____ 13. The import statement that imports just the functions sqrt and log from the math module? a. import from math sqrt log c. form math import sqrt log b. import form math sqrt, log d. from math import sqrt, log ____ 14. In order for a python program to run it must be translated into which of the following? a. system software c. assembly language b. machine code d. an lower level language ____ 15. Considered the first computer programmer? a. Ada Lovelace c. Charles Baggage b. Grace Hopper d. Alan Turin ____ 16. Python is considered what type of language ? a. A compiled language c. An interpreted language b. A lower level language d. An assembly language ____ 17. Which of the following is not a data type of python ? a. int c. str b. float d. binary ____ 18. Which of the following character strings inserts a new line character into a string? a. \t c. \\ b. \n d. \L ____ 19. Which of the following is not a proper variable name in python ? a. _name c. $firstName b. Last_name d. total4Today 2 Name: ________________________ ID: A ____ 20. If the following characters were to be sorted in alphabetically order what would be the result? M n$4 a. Mn$4 c. $4Mn b. nM4$ d. 4Mn$ 3 ID: A FOP Chapter 1 & 2 Answer Section MULTIPLE CHOICE 1. ANS: C PTS: 1 2. ANS: B PTS: 2 3. ANS: C PTS: 3 4. ANS: D PTS: 4 5. ANS: C PTS: 5 6. ANS: C PTS: 6 7. ANS: D PTS: 7 8. ANS: B PTS: 8 9. ANS: A PTS: 9 10. ANS: C PTS: 10 11. ANS: B PTS: 11 12. ANS: D PTS: 12 13. ANS: D PTS: 13 14. ANS: B PTS: 14 15. ANS: A PTS: 15 16. ANS: C PTS: 16 17. ANS: D PTS: 17 18. ANS: B PTS: 18 19. ANS: C PTS: 19 20. ANS: C PTS: 20 1

Use Quizgecko on...
Browser
Browser