QuestionQuestion

QUESTION 1
The default value for the GUI column Grid attribute is ____.
0
False
'left'
'right'

QUESTION 2
Consider the following program. What is displayed when it executes?
class Dinosaur :
    def __init__(self, name='dinosaur') :
       self._name = name
    def display(self) :
       print(self._name)
class Triceratops(Dinosaur) :
    def __init__(self) :
    super().__init__('triceratops')
x = Triceratops()
x.display()

dinosaur
triceratops
Nothing is displayed
The program crashes with a method not implemented error

QUESTION 3
In this code segment, root is ____.
ageValue = IntVar()
ageValue.set(100)
age = Entry(root, width=5, textvariable=ageValue)

The containing element for the widget
the name of the event-handling function called when the element is clicked
the name of the variable that represent any data entered in the widget
is the name of the layout manager used by the widget

QUESTION 4
Which of the following is true regarding subclasses?

A subclass that inherits methods from its superclass may not override the methods.
A subclass that inherits instance variables from its superclass may not declare additional instance variables.
A subclass may inherit methods or instance variables from its superclass but not both.
"A subclass may inherit methods and instance variables from its superclass, and may also implement its own methods and
declare its own instance variables."

QUESTION 5
A ____ exception is raised when Python attempts to convert a string with a bad format to a number.

ConversionError
ValueError
ParsingError
FormatError

QUESTION 6
A(n) ____ layout allows the GUI programmer to place components in the cells of an invisible grid in the window.

cell
grid
MVC
model/view

QUESTION 7
What is the purpose of using an inheritance hierarchy?

To share common code among the classes
To create objects from concrete classes
To create objects from abstract classes
To create objects using constructors

QUESTION 8
Given the following code, identify the subclass and superclass:

class ChoiceQuestion(Question) :
    def __init__(self)
       pass

"the subclass is Question, the superclass is ChoiceQuestion"
"the subclass is ChoiceQuestion, the superclass is Question"
"the subclass is init, the superclass is self"
"the subclass is ChoiceQuestion, the superclass is ChoiceQuestion"

QUESTION 9
With tkinter radiobuttons, each button should have the same variable name in order to have the radio buttons be part of a group, but you should assign each button a different value property in order to distinguish which button is checked.
True
False

QUESTION 10
"Consider this checkbox code. When checked ____
self._cb1 = BooleanVar()
Checkbutton(self, text=tea, variable = _cb1, command = foop)

self._cb2 = BooleanVar()
Checkbutton(self, text=coffee, variable = _cb2, command = foop)

which button is checked is determined using the variable value _cb1 or _cb2.

which button is checked is determined by the text property which is used to distinguish one button from another.

QUESTION 11
A class that represents a more specific entity in an inheritance hierarchy is called a/an _____.

Default class
Superclass
Subclass
Inheritance class

QUESTION 12
Which of the following statements about inheritance is correct?

You can always use a superclass object in place of a subclass object.
You can always use a subclass object in place of a superclass object.
A superclass inherits data and behavior from a subclass.
A superclass inherits only behavior from a subclass.

QUESTION 13
What does the subclass inherit from a superclass?

Data and behavior
Only behaviors
Only data
Nothing

QUESTION 14
"You are creating a Motorcycle class that will be a subclass of a Vehicle class. Which statement accomplishes this goal?"

class Motorcycle(Vehicle):
subclass Motorcycle(Vehicle):
class Vehicle(Motorcycle):
subclass Vehicle(Motorcycle):

QUESTION 15
The ____ class includes a wide array of methods for managing items in a list box.

Tkinter.ListBo
Tkinter.Listbox < -- pick this answer.
Tkinter.TextBox
Tkinter.Textbo

QUESTION 16
In this code segment transferName is _____.
btn1 = Button(root, text='Move Name', command=transferName)
btn1.grid(row=1, column=0, padx=3, pady=9)

The containing element for the widget
the name of the event-handling function called when the element is clicked
the name of the variable that represent any data entered in the widget
is the name of the layout manager used by the widget

QUESTION 17
What type of method is used to extend or replace the functionality of the superclass method?

Concrete method
Abstract method
Overriding method
Constructor method

QUESTION 18
You can associate a mouse event and an event-handling method with a widget by calling the ____ method.

assign
associate
bind
link

QUESTION 19
What must be included in the subclass constructor as the first statement?

Initialization of all instance variables
A call to the superclass constructor
A call to the accessor and mutator methods
A call to the subclass constructor

QUESTION 20
"To activate a button and enable it to respond to mouse clicks, you must set its command attribute to a(n) ____ method."

label
widget
trigger
event-handling

QUESTION 21
Which of the following statements about superclasses and subclasses is true?

A superclass is larger than its subclass.
A superclass inherits from a subclass.
A superclass extends a subclass.
A subclass extends a superclass.

QUESTION 22
In this code segment, ageValue is ____.
ageValue = IntVar()
ageValue.set(100)
age = Entry(root, width=5, textvariable=ageValue)

The containing element for the widget
the name of the event-handling function called when the element is clicked
the name of the variable that represent any data entered in the widget
is the name of the layout manager used by the widget

QUESTION 23
Consider four classes named Oranges, Pears, Apples, and Fruit. Which should be the superclass? .

Oranges
Pears
Apples
Fruit

QUESTION 24
Which of the following is NOT true about a subclass that overrides a superclass method?

The subclass extends the functionality of the superclass version
"The subclass method carries out the action of the superclass method, and it also does some additional work"
The subclass method can have additional arguments than the superclass method
A subclass method can replace the funcationality of a superclass method

QUESTION 25
"In GUI-based programs, ____ are boxes within which the program can output text or receive it as input from the user."

labels
title bars
command buttons
entry fields

QUESTION 26
Which method is being overridden in the following code segment?
class Car(mover) :
    def __init__(self, make, model, color) :
       . . .
    def getMake(self) :
       . . .
    def getModel(self) :
       . . .
    def getColor(self) :
       . . .
class Apple(fruit) :
    def __init__(self, color) :
       . . .
    def getColor(self) :
       . . .

getMake
getModel
getColor
No method is being overridden in this code segment

QUESTION 27
Consider the following class definitions. Which of the following statements is most correct?
class Fruit :
    . . .
    def getColor(self) :
       . . .

class Apple(Fruit) :

Apple cannot have a method named getColor
Apple inherits the getColor method from Fruit
Apple must override the getColor method from Fruit
Apple must call the getColor method from Fruit

QUESTION 28
"In this code segment, how do you distinguish the button that is checked?.
self.fruit = StringVar()
Radiobutton(self, text = Pear, variable = self.fruit, value = 'pear', command= self.dx)
Radiobutton(self, text = Orange, variable = self.fruit, value = 'orange', command = self.dx)

it's determined by the text property which is used to distinguish one button in the group from another.
it's determined by the value property which is used to distinguish one button in the group from another.

QUESTION 29
"In GUI-based programs, mouse-clicks are user-generated ____."

triggers
events

QUESTION 30
Consider the following code segment. Which statement is most correct?
class Fruit :
    . . .
    def getName(self) :
       . . .

class Apple(Fruit)
    : . . .
    def getName(self) : . . .

The Apple class clones the Fruit class
The Apple class method overrides the getName method
The Fruit class overrides the Apple class
The Fruit class overrides the getName method

QUESTION 31
With tkinter checkboxes, to set up a group you would do which of the following. choose 3 answers.

give each button in the group the same command property that points to the same callback function name.
give each check button a text property
give each box a unique boolean variable name
give each box the same boolean variable name

QUESTION 32
To determine which checkbox was checked, in the callback function your code would determine if one or more check buttons were checked or not by examining the value of each Boolean variable in the checkbox group.

True
False

QUESTION 33
To determine which radio button in a group is checked, what must you do. Choose 3 answers.

give each button the same variable name.
give each button a different value property.
read the value of the text property to distinguish which button was checked..
read the value of the variable in the callback function to distinguish which button was checked.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

Question 1: The answer is option A
Question 2: The answer is option B
Question 3: The answer is option A
Question 4: The answer is option D
Question 5: The answer is option B...

By purchasing this solution you'll be able to access the following files:
Solution.docx.

$24.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats