Deck 3: Objects, Events, and Graphical User Interfaces

Full screen (f)
exit full mode
Question
Until this century, most programming languages were procedural.
Use Space or
up arrow
down arrow
to flip the card.
Question
Object oriented languages such as FORTRAN, COBOL, Basic, Pascal, and C, focused on actions to be performed.
Question
Object-oriented languages focus on the objects of programming, not just the actions performed on them.
Question
In programming, objects have properties, which describe the object's characteristics.
Question
An object's properties are defined in the class.
Question
Methods are usually represented by modules or functions, which are run or "called" when needed.
Question
Calling an object's method is sometimes described as sending a message to the object.
Question
The computer creates an object in two steps: associating a class name with an object name and then calling the constructor method to prepare memory space for the object.
Question
A constructor usually has the same name as the class and is called with the keyword var in an assignment statement.
Question
When you instantiate an object from a class, you give a name to this particular object so that your program can distinguish it from other objects you instantiate from the same class.
Question
A class is like a blueprint; it is not the actual object.
Question
In object-oriented programming, class definition files can be stored separately from programs that use them to instantiate objects, or class definitions can be combined with a program into one file.
Question
In pseudocode, a constructor method starts with the keywords Constructor Method and ends with the keywords End While.
Question
Methods in class diagrams include the method name and data types as well as parameter names in parentheses to match any arguments the method needs.
Question
Methods are usually nouns because they describe things.
Question
Variable names are usually verbs because they describe actions.
Question
In JavaScript, a constructor needs to link an object to other functions so that methods are performed only on the object that calls them.
Question
A dynamic property has only one value for the whole class.
Question
A static method can be called independently of a separate object.
Question
Google developed the Disk Operating System (DOS) for IBM and IBM-compatible computers, which became known as PCs.
Question
A form is created with HTML tags, not JavaScript code, in the <body> section of the HTML file with the <form> tag.
Question
Text boxes are a group of circular buttons, used to select one item from a group.
Question
You will need a <script> section in the body of an HTML file used to create a form.
Question
Text boxes are used for two purposes: to give the user a place to enter text and to give the programmer a label with text that can be changed.
Question
With event-driven programming, users being asked predetermined questions in a specified order, they can decide what options to choose at any time.
Question
A(n) ____ is an entity, something with a distinct existence.

A) class
B) object
C) function
D) parameter
Question
In programming, objects have ____, which define what the object can do or be made to do.

A) events
B) access modifiers
C) methods
D) parameters
Question
A(n) ____ is the template or description a programmer uses to create an object.

A) class
B) access modifier
C) function
D) parameter
Question
A(n) ____ method is called when an object is instantiated.

A) parameter
B) instance
C) constructor
D) static
Question
____ are variables that need to receive arguments.

A) Parameters
B) Objects
C) Properties
D) Modifiers
Question
The following constructor method has ____ parameters.
Constructor Method Account(String type, Numeric num,
String lName, String fName, Numeric bal)
AcctType = type
AcctNumber = num
LastName = lName
FirstName = fName
AcctBal = bal
End Method

A) two
B) three
C) four
D) five
Question
A(n) ____ is a UML diagram describing the makeup of a class.

A) screen form
B) class diagram
C) object
D) access modifier
Question
A(n) ____ has a simple format, with three sections: name, properties, and methods.

A) screen form
B) class diagram
C) access modifier
D) graphical user interface
Question
Which of the following functions correctly returns the argument value times 10?

A) new timesTen(num) {var result = num * 10; return result;}
B) timesTen(num) {var result == num * 10; return result;}
C) function timesTen(num) {var result == num; return result;}
D) function timesTen(num) {var result = num * 10; return result;}
Question
Function definitions are placed in the ____ section of an HTML file.

A) <head>
B) <body>
C) <title>
D) <br>
Question
You create an object with the keyword ____.

A) input
B) prompt
C) new
D) var
Question
Which of the following methods returns a value?

A) Method changeName(String lName, String fName)
LastName = lName
FirstName = fName
Display "The name has been changed to " + firstName + " " + lastName
End Method

B) Method displayInfo()
Display "Account #: " + acctNumber
Display "Account type: " + acctType
Display "Owner name: " + lastName + ", " + firstName
Display "Current balance: " + acctBal
End Method

C) Method withdraw(Numeric amt)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

D) Method inquire()
Return acctBal
End Method
Question
Which of the following methods correctly withdraws an amount from a bank account?

A) Method withdraw(Numeric amt)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

B) Method withdraw(String amt)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

C) Method withdraw(Numeric amount)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

D) Method withdraw(String amount)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method
Question
The keywords Public and Private are used to allow and disallow access by other programs, so they are called ____.

A) access values
B) constructors
C) access modifiers
D) access prompts
Question
In JavaScript, the ____ object refers to the Web page where the text in HTML documents and output from your JavaScript programs are displayed.

A) HTTP
B) document
C) UML
D) DNS
Question
In JavaScript, the ____ object is instantiated automatically when an HTML file is opened in a Web browser, and it belongs to the Document Object Model (DOM).

A) UML
B) document
C) HTTP
D) DNS
Question
Properties and methods belonging to each object instantiated from a class are known as ____.

A) instance properties and instance methods
B) validated properties and validated methods
C) compiled properties and compiled methods
D) interpreted properties and interpreted methods
Question
Which of the following represents an HTML paragraph break?

A) var ES = "";
B) var PA = "<p />";
C) var BR = "<br />";
D) var NL = "\n";
Question
The Math object includes the ____ method, which returns the value of the next highest whole number.

A) abs()
B) floor()
C) ceil()
D) max()
Question
The Math object includes the ____ method, which takes two arguments and returns the higher value.

A) abs()
B) floor()
C) ceil()
D) max()
Question
Which of the following tags creates a form with the name OrderForm?

A) <form name="OrderForm">
B) <form name="OrderForm" action="">
C) <form name=="OrderForm" action>
D) <form name=OrderForm action="">
Question
Elements of a form - including buttons, text boxes, radio buttons, check boxes, and other graphical items used to interact with a program - are placed on a Web page with the ____ HTML tag.

A) <input>
B) <form>
C) <body>
D) <script>
Question
Which of the following functions assigns the current radio button's value to the nextColor variable?

A) displayName()
B) setImage()
C) setColor()
D) changeColor()
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/48
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Objects, Events, and Graphical User Interfaces
1
Until this century, most programming languages were procedural.
False
2
Object oriented languages such as FORTRAN, COBOL, Basic, Pascal, and C, focused on actions to be performed.
False
3
Object-oriented languages focus on the objects of programming, not just the actions performed on them.
True
4
In programming, objects have properties, which describe the object's characteristics.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
5
An object's properties are defined in the class.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
6
Methods are usually represented by modules or functions, which are run or "called" when needed.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
7
Calling an object's method is sometimes described as sending a message to the object.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
8
The computer creates an object in two steps: associating a class name with an object name and then calling the constructor method to prepare memory space for the object.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
9
A constructor usually has the same name as the class and is called with the keyword var in an assignment statement.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
10
When you instantiate an object from a class, you give a name to this particular object so that your program can distinguish it from other objects you instantiate from the same class.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
11
A class is like a blueprint; it is not the actual object.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
12
In object-oriented programming, class definition files can be stored separately from programs that use them to instantiate objects, or class definitions can be combined with a program into one file.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
13
In pseudocode, a constructor method starts with the keywords Constructor Method and ends with the keywords End While.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
14
Methods in class diagrams include the method name and data types as well as parameter names in parentheses to match any arguments the method needs.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
15
Methods are usually nouns because they describe things.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
16
Variable names are usually verbs because they describe actions.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
17
In JavaScript, a constructor needs to link an object to other functions so that methods are performed only on the object that calls them.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
18
A dynamic property has only one value for the whole class.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
19
A static method can be called independently of a separate object.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
20
Google developed the Disk Operating System (DOS) for IBM and IBM-compatible computers, which became known as PCs.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
21
A form is created with HTML tags, not JavaScript code, in the <body> section of the HTML file with the <form> tag.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
22
Text boxes are a group of circular buttons, used to select one item from a group.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
23
You will need a <script> section in the body of an HTML file used to create a form.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
24
Text boxes are used for two purposes: to give the user a place to enter text and to give the programmer a label with text that can be changed.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
25
With event-driven programming, users being asked predetermined questions in a specified order, they can decide what options to choose at any time.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
26
A(n) ____ is an entity, something with a distinct existence.

A) class
B) object
C) function
D) parameter
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
27
In programming, objects have ____, which define what the object can do or be made to do.

A) events
B) access modifiers
C) methods
D) parameters
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
28
A(n) ____ is the template or description a programmer uses to create an object.

A) class
B) access modifier
C) function
D) parameter
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
29
A(n) ____ method is called when an object is instantiated.

A) parameter
B) instance
C) constructor
D) static
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
30
____ are variables that need to receive arguments.

A) Parameters
B) Objects
C) Properties
D) Modifiers
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
31
The following constructor method has ____ parameters.
Constructor Method Account(String type, Numeric num,
String lName, String fName, Numeric bal)
AcctType = type
AcctNumber = num
LastName = lName
FirstName = fName
AcctBal = bal
End Method

A) two
B) three
C) four
D) five
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
32
A(n) ____ is a UML diagram describing the makeup of a class.

A) screen form
B) class diagram
C) object
D) access modifier
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
33
A(n) ____ has a simple format, with three sections: name, properties, and methods.

A) screen form
B) class diagram
C) access modifier
D) graphical user interface
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
34
Which of the following functions correctly returns the argument value times 10?

A) new timesTen(num) {var result = num * 10; return result;}
B) timesTen(num) {var result == num * 10; return result;}
C) function timesTen(num) {var result == num; return result;}
D) function timesTen(num) {var result = num * 10; return result;}
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
35
Function definitions are placed in the ____ section of an HTML file.

A) <head>
B) <body>
C) <title>
D) <br>
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
36
You create an object with the keyword ____.

A) input
B) prompt
C) new
D) var
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following methods returns a value?

A) Method changeName(String lName, String fName)
LastName = lName
FirstName = fName
Display "The name has been changed to " + firstName + " " + lastName
End Method

B) Method displayInfo()
Display "Account #: " + acctNumber
Display "Account type: " + acctType
Display "Owner name: " + lastName + ", " + firstName
Display "Current balance: " + acctBal
End Method

C) Method withdraw(Numeric amt)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

D) Method inquire()
Return acctBal
End Method
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following methods correctly withdraws an amount from a bank account?

A) Method withdraw(Numeric amt)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

B) Method withdraw(String amt)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

C) Method withdraw(Numeric amount)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method

D) Method withdraw(String amount)
AcctBal = acctBal - amt
Display "The new balance is: $" + acctBal
End Method
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
39
The keywords Public and Private are used to allow and disallow access by other programs, so they are called ____.

A) access values
B) constructors
C) access modifiers
D) access prompts
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
40
In JavaScript, the ____ object refers to the Web page where the text in HTML documents and output from your JavaScript programs are displayed.

A) HTTP
B) document
C) UML
D) DNS
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
41
In JavaScript, the ____ object is instantiated automatically when an HTML file is opened in a Web browser, and it belongs to the Document Object Model (DOM).

A) UML
B) document
C) HTTP
D) DNS
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
42
Properties and methods belonging to each object instantiated from a class are known as ____.

A) instance properties and instance methods
B) validated properties and validated methods
C) compiled properties and compiled methods
D) interpreted properties and interpreted methods
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
43
Which of the following represents an HTML paragraph break?

A) var ES = "";
B) var PA = "<p />";
C) var BR = "<br />";
D) var NL = "\n";
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
44
The Math object includes the ____ method, which returns the value of the next highest whole number.

A) abs()
B) floor()
C) ceil()
D) max()
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
45
The Math object includes the ____ method, which takes two arguments and returns the higher value.

A) abs()
B) floor()
C) ceil()
D) max()
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following tags creates a form with the name OrderForm?

A) <form name="OrderForm">
B) <form name="OrderForm" action="">
C) <form name=="OrderForm" action>
D) <form name=OrderForm action="">
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
47
Elements of a form - including buttons, text boxes, radio buttons, check boxes, and other graphical items used to interact with a program - are placed on a Web page with the ____ HTML tag.

A) <input>
B) <form>
C) <body>
D) <script>
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
48
Which of the following functions assigns the current radio button's value to the nextColor variable?

A) displayName()
B) setImage()
C) setColor()
D) changeColor()
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 48 flashcards in this deck.