Computer Programming 2 Final Exam Review: Question Preview (ID: 31462)


Below is a preview of the questions contained within the game titled COMPUTER PROGRAMMING 2 FINAL EXAM REVIEW: Use These Games To Help You Review For The Programming 2 Final Exam. To play games using this data set, follow the directions below. Good luck and have fun. Enjoy! [print these questions]


Play games to reveal the correct answers. Click here to play a game and get the answers.

Which text widget option will remove text from a widget?
a) erase() b) delete() c) insert() d) del()
A GUI widget that only allows you to select one among many options.
a) Checkbox b) Radio button c) Button d) Label
Which line of code will import the Tkinter module?
a) from Tkinter import all b) from Tk import * c) import Tkinter d) from Tkinter import *
Which method would you write to alter the value of an object's attribute?
a) get method b) set method c) update method d) change method
How do you bind an event to an event handler?
a) mainloop() b) Use 'command = xxx' during object creation c) By creating a submit button d) By calling another method in the init method
What’s the purpose of grid()?
a) To display the root GUI window b) Layout manager that puts the widget in a container and positions it c) To position elements in the frame d) None of the above
What’s the difference between Text and Entry in a GUI app?
a) Entry is just one row, and Text is defined by how many rows and columns. b) You can only write to Text. c) Text is just one row, and Entry is defined by how many rows and columns. d) You can only write to Entry.
What is an 'event driven program'?
a) A sequential program that runs based on user input b) A sequential program that runs based on predetermined events c) A non-sequential program that runs based on user input d) A non-sequential program that runs based on predetermined events
What is a parameter?
a) What a function returns. b) A special kind of variable used in a function. c) A keyword in Python. d) Part of a calculation in a function.
Should methods be public or private?
a) Methods that we use as a “client” should be public b) Private always c) It depends d) You should have both
What is a “class attribute”?
a) Common attribute between two objects b) Common attribute across the class—not saved in each object c) Attribute accessible by way of an object only d) An attribute stored in the __init__
What method sets the size of a root window?
a) root.geometry(“200x100”) b) root.size(“200x100”) c) root(“200x100”) d) root.dimensions(“200x100”)
Why might you use a static method?
a) To call another method b) If your method will not be changing c) If you want something to stay constant d) To access a class attribute
Should attributes be public or private?
a) Private but Python doesn’t keep you from accessing them b) Public c) It depends d) You should have both
What kind of object does a check button need associated with it to reflect the check button’s status?
a) StringVar b) BooleanVar c) IntVar d) IntegerVar
What is a constructor?
a) a special type of class b) a function to create an object c) method called when you create an object d) the base of a GUI program
readlines() means:
a) reads all the lines from the file into a list b) reads all the lines from the file into a tuple c) reads all the lines from the file into a string d) reads all the lines from the file, but don't do anything
read(10) means...
a) read the first 10 lines of a file b) read the first 10 characters of a file c) read the first 9 characters of a file d) read the first 9 lines of a file
What can you do to a closed file?
a) Read from it b) Write to it c) All of the above d) None of the above
Which of these statements is true?
a) You must have a submit button to make a GUI app event-driven. b) Creating a variable inside a function makes it global. c) You can't call a static method unless you've instantiated at least one object. d) Usually, you want to avoid directly accessing an object’s attributes outside of its class definition.
Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from the data set above, visit ReviewGameZone.com and enter game ID number: 31462 in the upper right hand corner at ReviewGameZone.com or simply click on the link above this text.

TEACHERS / EDUCATORS
Log In
| Sign Up / Register