Deck 9: Menus and Data Validation

ملء الشاشة (f)
exit full mode
سؤال
Programs that can handle all kinds of user errors, without allowing damage, and can do it immediately, correctly, and smoothly, are called robust.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Programs that can handle all kinds of user errors are called elegant.
سؤال
A common acronym in the computer field is GIGO, standing for "going in, going out."
سؤال
A menu system limits the choices a user can make so that only valid options are processed.
سؤال
When prompting users to enter a character, you should allow uppercase or lowercase input.
سؤال
When you use a menu system, the most common model is a menu that stays onscreen to use repeatedly, instead of a menu that allows users to make only one choice.
سؤال
When creating a menu system, you should display an error message, as a form of data validation, if the user does not enter a valid choice (including the exit choice).
سؤال
To create a menu that is used more than once, a repetition structure that encloses the selection structure is more suitable, and you can also add a choice for the user to exit the menu.
سؤال
Consistency is important for good programming design and readability.
سؤال
In JavaScript, functions are listed second, in the <body> section of HTML.
سؤال
When modules and functions are used as menu-processing choices, you can design a menu system easily by using the top-down method of program design.
سؤال
The Case structure is a variation of the If/Else structure.
سؤال
Text data (data of the String type) consists of almost anything the user can type at the keyboard.
سؤال
isNumeric(str) is a string manipulation function.
سؤال
isLetter(str) is a string manipulation function.
سؤال
JavaScript converts a number to a string format automatically if the number needs to be displayed as text.
سؤال
Function calls start with the function name and are followed by the arguments (which can be constants or variables) in parentheses.
سؤال
Method calls start with the method name and are followed by a dot, the object name, and parentheses for enclosing arguments.
سؤال
In JavaScript, strings are not considered objects.
سؤال
In some programming languages, when a user presses Enter without typing anything, the input variable's value is set to a constant called NULL.
سؤال
Typical exception types are "invalid format" and "attempted division by zero."
سؤال
In a do-while loop, the closing brace is followed by the keyword end, the condition, and a semicolon.
سؤال
In JavaScript, conditions are enclosed in parentheses.
سؤال
Keywords (such as if, else, do, and while) are uppercase in JavaScript.
سؤال
One way to validate an e-mail address is to see whether the character @ occurs in the string.
سؤال
____ is a method in which data is processed noninteractively, requiring prior data validation.

A) Exception handling
B) Batch processing
C) Validation looping
D) Interactive processing
سؤال
Transaction processing is done immediately, so it is referred to as ____.

A) batch processing
B) coupling
C) short-circuit evaluation
D) interactive processing
سؤال
Interactive processing is also known as ____.

A) batch processing
B) coupling
C) short-circuit evaluation
D) real-time processing
سؤال
A(n) ____ is a pop-up box that requires the user to click OK before proceeding.

A) blue box
B) submenu
C) alert box
D) black box
سؤال
In JavaScript, constants are declared in the ____ section before any function definitions so that they're available to the ____ section.

A) <h2>, <h2>
B) <head>, <head>
C) <body>, <body>
D) <form>, <form>
سؤال
In JavaScript, the toUpperCase() function is called by using the ____ format.

A) object.method()
B) alert.object()
C) object.parameter()
D) var.object()
سؤال
A module is sometimes called a ____ because those looking at the module do not need to know what it contains internally, as long as they know the module's purpose and how to use it.

A) blue box
B) red box
C) white box
D) black box
سؤال
A(n) ____ serves as a placeholder in your program until you develop the code.

A) stub
B) array
C) decision table
D) subscript
سؤال
A(n) ____ enables you to test your program so that you can make sure the module is called correctly.

A) stub
B) decision table
C) array
D) subscript
سؤال
A(n) ____ is a loop that checks for valid input and repeats until valid input has been entered.

A) indeterminate loop
B) posttest loop
C) validation loop
D) pretest loop
سؤال
Functions that operate on strings are called ____.

A) validation functions
B) exceptions
C) multilevel functions
D) string manipulation functions
سؤال
The function ____ returns True if the text can be converted to a number.

A) isNumeric(str)
B) numberToString(num)
C) isLetter(str)
D) stringToNumber(str)
سؤال
JavaScript has a function called ____ that returns a True value if a string cannot be converted to a number.

A) isNumeric(str)
B) isNaN()
C) numberToString(num)
D) isLetter(str)
سؤال
The ____ returns the number of characters in a string.

A) isNaN()
B) numChars(str)
C) number(str)
D) length(str)
سؤال
The ____ returns a substring of the original string, starting with the position specified by the start argument and including the number of characters specified by numChars.

A) isNaN()
B) substring(str, start, numChars)
C) isNaN().
D) length(str)
سؤال
You can use string manipulation functions to check every character in a string, a process sometimes called ____ a string.

A) traversing
B) interactive processing
C) batch processing
D) exception handling
سؤال
In object-oriented programming, ____ is a method that allows for errors to be detected without having to write error-checking code at every point of input.

A) exception handling
B) batch processing
C) interactive processing
D) string manipulation
سؤال
In JavaScript, the ____ statement should be accompanied by an error message, which is not enclosed in parentheses.

A) throw
B) case
C) try
D) catch
سؤال
In JavaScript, the ____ block checks to see what the error message is before proceeding.

A) throw
B) case
C) try
D) catch
سؤال
A(n) ____ presents a main menu, and then leads users to submenus.

A) black box
B) object
C) multilevel menu
D) alert box
سؤال
A(n) ____ can be designed without using modules, but top-down design is easier when you use modules as a starting point for designing a menu.

A) black box
B) object
C) multilevel menu
D) alert box
سؤال
A graphical tool called a(n) ____ can help you keep track of which modules call other modules.

A) UML diagram
B) hierarchy chart
C) decision table
D) flowchart
سؤال
A(n) ____ is useful for seeing a program's overall structure as well as providing a guide for making changes.

A) decision table
B) UML diagram
C) hierarchy chart
D) flowchart
سؤال
<strong>   -The accompanying diagram is known as a ____.</strong> A) hierarchy chart B) truth table C) decision table D) flowchart <div style=padding-top: 35px>

-The accompanying diagram is known as a ____.

A) hierarchy chart
B) truth table
C) decision table
D) flowchart
سؤال
JavaScript has a built-in method, ____, that takes a character as an argument and returns the position in a string where the character occurs or -1 if the character isn't found.

A) isNaN()
B) indexOf()
C) isNumeric(str)
D) length(str)
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Menus and Data Validation
1
Programs that can handle all kinds of user errors, without allowing damage, and can do it immediately, correctly, and smoothly, are called robust.
False
2
Programs that can handle all kinds of user errors are called elegant.
False
3
A common acronym in the computer field is GIGO, standing for "going in, going out."
False
4
A menu system limits the choices a user can make so that only valid options are processed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
When prompting users to enter a character, you should allow uppercase or lowercase input.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
When you use a menu system, the most common model is a menu that stays onscreen to use repeatedly, instead of a menu that allows users to make only one choice.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
When creating a menu system, you should display an error message, as a form of data validation, if the user does not enter a valid choice (including the exit choice).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
To create a menu that is used more than once, a repetition structure that encloses the selection structure is more suitable, and you can also add a choice for the user to exit the menu.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
Consistency is important for good programming design and readability.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
In JavaScript, functions are listed second, in the <body> section of HTML.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
When modules and functions are used as menu-processing choices, you can design a menu system easily by using the top-down method of program design.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
The Case structure is a variation of the If/Else structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
Text data (data of the String type) consists of almost anything the user can type at the keyboard.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
isNumeric(str) is a string manipulation function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
isLetter(str) is a string manipulation function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
JavaScript converts a number to a string format automatically if the number needs to be displayed as text.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
Function calls start with the function name and are followed by the arguments (which can be constants or variables) in parentheses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
Method calls start with the method name and are followed by a dot, the object name, and parentheses for enclosing arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
In JavaScript, strings are not considered objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
In some programming languages, when a user presses Enter without typing anything, the input variable's value is set to a constant called NULL.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
Typical exception types are "invalid format" and "attempted division by zero."
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
In a do-while loop, the closing brace is followed by the keyword end, the condition, and a semicolon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
In JavaScript, conditions are enclosed in parentheses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Keywords (such as if, else, do, and while) are uppercase in JavaScript.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
One way to validate an e-mail address is to see whether the character @ occurs in the string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
____ is a method in which data is processed noninteractively, requiring prior data validation.

A) Exception handling
B) Batch processing
C) Validation looping
D) Interactive processing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
Transaction processing is done immediately, so it is referred to as ____.

A) batch processing
B) coupling
C) short-circuit evaluation
D) interactive processing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
Interactive processing is also known as ____.

A) batch processing
B) coupling
C) short-circuit evaluation
D) real-time processing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
A(n) ____ is a pop-up box that requires the user to click OK before proceeding.

A) blue box
B) submenu
C) alert box
D) black box
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
In JavaScript, constants are declared in the ____ section before any function definitions so that they're available to the ____ section.

A) <h2>, <h2>
B) <head>, <head>
C) <body>, <body>
D) <form>, <form>
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
In JavaScript, the toUpperCase() function is called by using the ____ format.

A) object.method()
B) alert.object()
C) object.parameter()
D) var.object()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
A module is sometimes called a ____ because those looking at the module do not need to know what it contains internally, as long as they know the module's purpose and how to use it.

A) blue box
B) red box
C) white box
D) black box
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
A(n) ____ serves as a placeholder in your program until you develop the code.

A) stub
B) array
C) decision table
D) subscript
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
A(n) ____ enables you to test your program so that you can make sure the module is called correctly.

A) stub
B) decision table
C) array
D) subscript
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
A(n) ____ is a loop that checks for valid input and repeats until valid input has been entered.

A) indeterminate loop
B) posttest loop
C) validation loop
D) pretest loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
Functions that operate on strings are called ____.

A) validation functions
B) exceptions
C) multilevel functions
D) string manipulation functions
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
The function ____ returns True if the text can be converted to a number.

A) isNumeric(str)
B) numberToString(num)
C) isLetter(str)
D) stringToNumber(str)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
JavaScript has a function called ____ that returns a True value if a string cannot be converted to a number.

A) isNumeric(str)
B) isNaN()
C) numberToString(num)
D) isLetter(str)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
The ____ returns the number of characters in a string.

A) isNaN()
B) numChars(str)
C) number(str)
D) length(str)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
The ____ returns a substring of the original string, starting with the position specified by the start argument and including the number of characters specified by numChars.

A) isNaN()
B) substring(str, start, numChars)
C) isNaN().
D) length(str)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
You can use string manipulation functions to check every character in a string, a process sometimes called ____ a string.

A) traversing
B) interactive processing
C) batch processing
D) exception handling
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
In object-oriented programming, ____ is a method that allows for errors to be detected without having to write error-checking code at every point of input.

A) exception handling
B) batch processing
C) interactive processing
D) string manipulation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
In JavaScript, the ____ statement should be accompanied by an error message, which is not enclosed in parentheses.

A) throw
B) case
C) try
D) catch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
In JavaScript, the ____ block checks to see what the error message is before proceeding.

A) throw
B) case
C) try
D) catch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
A(n) ____ presents a main menu, and then leads users to submenus.

A) black box
B) object
C) multilevel menu
D) alert box
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
A(n) ____ can be designed without using modules, but top-down design is easier when you use modules as a starting point for designing a menu.

A) black box
B) object
C) multilevel menu
D) alert box
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
A graphical tool called a(n) ____ can help you keep track of which modules call other modules.

A) UML diagram
B) hierarchy chart
C) decision table
D) flowchart
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
A(n) ____ is useful for seeing a program's overall structure as well as providing a guide for making changes.

A) decision table
B) UML diagram
C) hierarchy chart
D) flowchart
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
<strong>   -The accompanying diagram is known as a ____.</strong> A) hierarchy chart B) truth table C) decision table D) flowchart

-The accompanying diagram is known as a ____.

A) hierarchy chart
B) truth table
C) decision table
D) flowchart
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
JavaScript has a built-in method, ____, that takes a character as an argument and returns the position in a string where the character occurs or -1 if the character isn't found.

A) isNaN()
B) indexOf()
C) isNumeric(str)
D) length(str)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.