Programming Right From the Start with Visual Basic.NET CHAPTER 1 Input, Process, Output True-False Questions 1. Computer programs are used to solve problems. Answer: True Section: 1-1 Level: Easy Page: 4 2. Programs are divided into two parts: algorithms and logic. Answer: False Level: Moderate Section: 1-1 Page: 4 3. A programming language is an example of the syntax used to create a solution to a problem. Answer: True Level: Easy Section: 1-1 Page: 4 4. An algorithm is like a recipe used in cooking. Answer: True Section: 1-1 Level: Moderate Page: 4 5. An information system refers to all of the computers used to collect data for an organization. Answer: False Level: Hard Section: 1-1 Page: 4 6. All useful information systems have two parts: Input and Output. Answer: False Level: Moderate Section: 1-1 Page: 5 7. Processing is an essential part of any information system. Answer: True Level: Easy Section: 1-1 Page: 5 8. A flow chart is a graphical representation of a program’s logic. Answer: True Level: Easy Section: 1-1 Page: 4 9. All programs have a beginning and an end. Answer: True Section: 1-2 Level: Easy Page: 5 The flowchart symbol for Output is a rectangle. Answer: False Section: 1-2 Level: Easy Page: 6 10. 1-1 Chapter 1 – Input Process Output 11. The flowchart symbol for Input is a parallelogram. Answer: True Section: 1-3 Level: Easy Page: 8 12. The ampersand symbol (&) is used to link together variables and text. Answer: False Level: Moderate Section: 1-3 Page: 7 13. An input statement will sometimes store data in a variable. Answer: False Level: Easy Section: 1-3 Page: 7 14. The name of a variable is constant. Answer: True Section: 1-3 Level: Easy Page: 7 15. A variable has two parts, a name and the data value, both of which can change while the program is running. Answer: False Level: Easy Section: 1-3 Page: 7 16. String data and numeric data are the same and can be input into the program the same way. Answer: False Level: Hard Section: 1-3 Page: 7 17. Numeric data cannot include symbols such as the percent sign or commas. Answer: True Level: Easy Section: 1-3 Page: 7 18. Because a variable can have any name, ‘Sue’ is an acceptable name for a variable. Answer: False Level: Moderate Section: 1-4 Page: 9 19. In Visual Logic the variable Name is the same as the variable NAME. Answer: True Level: Moderate Section: 1-4 Page: 9 20. Assignment statements are used to process data. Answer: True Section: 1-5 Level: Moderate Page: 9 21. The flowchart element for an assignment statement is a triangle. Answer: False Level: Easy Section: 1-5 Page: 10 22. The assignment statement has two parts: an expression and a variable. Answer: True Level: Easy Section: 1-5 Page: 9 1-2 Chapter 1 – Input Process Output 23. The expression part of the assignment statement goes on the left hand side. Answer: False Level: Moderate Section: 1-5 Page: 9 24. The variable side of the assignment statement is processed last. Answer: True Level: Moderate Section: 1-5 Page: 9 25. The expression part of the assignment statement does not have to be a mathematical formula. Answer: True Level: Moderate Section: 1-5 Page: 9 26. The elements of an assignment statement are processed in order from left to right. Answer: False Level: Hard Section: 1-5 Page: 9 27. All mathematical operations are processed in the order of left to right as they appear in the equation. Answer: False Level: Easy Section: 1-5 Page: 10 28. The programmer can change the operator precedence by using parentheses. Answer: True Level: Moderate Section: 1-5 Page: 10 29. The Exponentiation Operation has the highest precedence. Answer: True Level: Easy Section: 1-5 Page: 10 30. The operations of Division and Integer Division have the same precedence. Answer: False Level: Moderate Section: 1-5 Page: 10 31. Integer division and integer remainder are unusual mathematical operations that only have use in specialized situations. Answer: False Level: Moderate Section: 1-5 Page: 11 32. Types of output can include sending data to the screen, a printer, or a floppy disk. Answer: True Level: Easy Section: 1-6 Page: 12 33. A literal string is text enclosed by either single quotes or double quotes. Answer: False Level: Moderate Section: 1-6 Page: 12 34. The flowchart symbols for Input and Output statements are identical. Answer: False Level: Easy Section: 1-6 Page: 12 1-3 Chapter 1 – Input Process Output 35. FormatPercent() is an example of an intrinsic function. Answer: True Level: Easy Section: 1-6 Page: 13 36. CurrencyFormat() is not an example of an intrinsic function. Answer: True Level: Moderate Section: 1-6 Page: 13 37. An output statement can only contain literal strings or variables. Answer: False Level: Moderate Section: 1-6 Page: 13 38. Concatenation is the term used to describe the process of joining literal strings, variables, and expressions. Answer: True Level: Easy Section: 1-6 Page: 14 39. The Step Over and Step Into options are used to run one command at a time. Answer: True Level: Easy Section: 1-7 Page: 14 40. Visual Logic allows the programmer to debug the program by examining variables in the Variable Watch window. Answer: True Level: Moderate Section: 1-7 Page: 14 Multiple Choice Questions 41. A computer program: a.) is a solution to a problem. b.) has an algorithm component. c.) has a syntax component. d.) has both b and c. e.) All of the above. Answer: e Section:1-1 42. Level: Easy Page: 4 An algorithm is the: a.) logical design of a computer program. b.) syntax design of a computer program. c.) physical design of a computer program. d.) language used to write a computer program. e.) same as an information system. Answer: a Section: 1-1 Level: Moderate Page: 4 1-4 Chapter 1 – Input Process Output 43. Which is the correct sequence of steps in an information system? a.) Data knowledge wisdom information b.) Knowledge wisdom information data c.) Information data wisdom knowledge d.) Data information knowledge wisdom e.) Information data knowledge wisdom Answer: d Section: 1-1 44. Level: Hard Page: 5 Syntax refers to the: a.) logical design of a computer program. b.) language used to create a computer program. c.) the graphical representation of a computer program. d.) flowchart of a computer program. e.) None of the above. Answer: b Section: 1-1 45. Level: Easy Page: 4 Which is not a primary component of an information system? a.) Input b.) Output c.) Debugging d.) Processing e.) All are primary components. Answer: c Section: 1-1 46. Level: Moderate Page: 5 Which symbol in a flowchart represents Input? a.) Parallelogram b.) Rectangle c.) Diamond d.) Hexagon e.) Square Answer: a Section: 1-2 47. Level: Easy Page: 6 Which symbol in a flowchart represents Output? a.) Parallelogram b.) Rectangle c.) Diamond d.) Hexagon e.) Square Answer: a Section: 1-2 Level: Easy Page: 6 1-5 Chapter 1 – Input Process Output 48. Which symbol in a flowchart represents an assignment statement? a.) Parallelogram b.) Rectangle c.) Diamond d.) Hexagon e.) Square Answer: b Section: 1-2 49. 50. 51. Level: Easy Page: 6 An ampersand is used to: a.) add together numbers. b.) represent a carriage return. c.) represent a line feed. d.) concatenate string items. e.) signal the end of the program. Answer: d Section: 1-3 Level: Moderate Page: 7 Which is true about a variable? a.) The name and data value can both change. b.) The name can change, but the data value cannot. c.) The name cannot change, but the data value can. d.) The name and the data value both cannot change. e.) A variable does not have a data value. Answer: c Section: 1-3 Level: Moderate Page: 7 Which symbol can sometimes be used when using numeric input? a.) Percent (%) b.) Decimal (.) c.) Dollar ($) d.) Comma (,) e.) All of the above. Answer: b Section: 1-3 52. Level: Easy Page: 8 Which statement takes data from a user and stores it in a variable? a.) Input b.) Assignment c.) Output d.) Input and output e.) All of the above. Answer: a Section: 1-3 Level: Easy Page: 7 1-6 Chapter 1 – Input Process Output 53. Which statement takes string literals, variables, and expressions and displays the data on a screen or printer? a.) Input b.) Assignment c.) Output d.) Input and output e.) All of the above. Answer: c Section: 1-6 54. Level: Easy Page: 12 Which statement performs mathematical operations on data and stores the result in a variable? a.) Input b.) Assignment c.) Output d.) Input and output e.) All of the above. Answer: b Section: 1-5 Level: Easy Page: 10 55. Which is not a rule for naming variables? a.) Use a descriptive name for the variable. b.) Start the name of a variable with a letter. c.) Use nothing but letters, digits, or the underscore character. d.) Do not use a reserved programming language word as a variable. e.) All of the above are appropriate rules for naming variables. Answer: e Level: Moderate Section: 1-4 Page: 9 56. An assignment statement will: a.) perform a calculation. b.) store the results of a calculation. c.) display the results of a calculation. d.) Both a and b. e.) All of the above. Answer: c Section: 1-5 57. Level: Moderate Page: 9 The correct order of operator precedence, from highest to lowest, is: a.) addition, integer division, exponentiation, multiplication. b.) addition, exponentiation, integer division, multiplication. c.) exponentiation, integer division, multiplication, addition. d.) exponentiation, multiplication, integer division, addition. e.) exponentiation, multiplication, addition, integer division. Answer: d Section: 1-5 Level: Hard Page: 10 1-7 Chapter 1 – Input Process Output 58. What is the correct result of the equation: 2 * 2 ^ 3? a.) 1.33 b.) 8 c.) 12 d.) 64 e.) 16 Answer: e Section: 1-5 59. Level: Moderate Page: 10 What is the correct result of the equation: 2 + 3 * 4? a.) 5 b.) 10 c.) 12 d.) 14 e.) 20 Answer: d Section: 1-5 60. Level: Moderate Page: 10 The term MOD is used for: a.) exponentiation. b.) multiplication. c.) division. d.) integer division. e.) integer remainder. Answer: e Section: 1-5 61. Level: Moderate Page: 10 Which is not considered a form of output? a.) Using a printer b.) Saving to a floppy disk c.) Saving to a hard drive d.) Displaying on a screen e.) All of the above are examples of output Answer: e Section: 1-6 62. Level: Easy Page: 12 How is a string literal created? a.) Using the ampersand symbol b.) Using an intrinsic function c.) Using single quotes d.) Using double quotes e.) All of the above. Answer: d Section: 1-6 Level: Moderate Page: 12 1-8 Chapter 1 – Input Process Output 63. What is a predefined command that adds functionality to the programming language called? a.) Algorithm b.) Pseudocode c.) Variable d.) Intrinsic function e.) Watch window Answer: d Section: 1-6 64. Level: Hard Page: 14 Which is not an example of an intrinsic function? a.) FormatCurrency b.) FormatPercent c.) FormatDollar d.) Round e.) Random Answer: c Section: 1-6 65. Level: Hard Page: 13 A variable watch window will appear when: a.) the program is being created. b.) the program is running. c.) the program is paused. d.) Both b and c. e.) All of the above. Answer: c Section: 1-7 Level: Hard Page: 14 1-9 Chapter 1 – Input Process Output Fill in the Blank Questions 66. A flowchart represents the ___logical____ design of a program. Level: Easy Section: 1-1 Page: 4 67. Pseudocode is one method for representing a(n) ____algorithm_____. Level: Moderate Section: 1-1 Page: 4 68. ___Syntax____ is the rules of a programming language. Level: Easy Section: 1-1 Page: 4 69. All ___information systems Level: Easy Section: 1-1 will input, process, and output data. Page: 5 70. The input statement is represented by a(n) ___parallelogram___. Level: Easy Section: 1-1 Page: 6 71. The ___assignment___ statement is represented by a rectangle. Level: Easy Section: 1-2 Page: 6 72. A(n) ___variable___ is used by the program as a store location for data. Level: Easy Section: 1-3 Page: 7 73. The ___input___ statement gets data from the user. Level: Easy Section: 1-3 Page: 7 74. The ___ampersand___ is used to concatenate string literals and variables. Level: Moderate Section: 1-3 Page: 7 75. Double quotes are used to indicate ___string___ data. Level: Easy Section: 1-6 Page: 12 76. ___Numeric___ data is entered as digits (sometimes with one decimal). Level: Easy Section: 1-3 Page: 8 77. Input statements are used to put ___data___ into variables. Level: Moderate Section: 1-3 Page: 8 1 - 10 Chapter 1 – Input Process Output 78. The name of a variable should ___describe__ the type of data being held by the variable. Level: Moderate Section: 1-3 Page: 9 79. The name of a variable must start with a(n) ___letter___. Level: Easy Section: 1-3 Page: 9 80. The ___assignment___ statement processes data and stores the result in a variable. Level: Easy Section: 1-5 Page: 9 81. The __expression___ is found on the right hand side of an assignment statement. Level: Moderate Section: 1-5 Page: 9 82. The __variable___ is found on the left hand side of an assignment statement. Level: Moderate Section: 1-5 Page: 9 83. Using ___parentheses___ will override the operator precedence for mathematical operations. Level: Hard Section: 1-5 Page: 10 84. The operation with the lowest order of precedence is ___addition/subtraction___. Level: Moderate Section: 1-5 Page: 10 85. Text found inside of double quotation marks is called a(n) ___string literal___. Level: Moderate Section: 1-6 Page: 12 86. ___Intrinsic__ functions are commands packaged with the programming language, which provide helpful functionality such as math operations, conversion functions, file access, etc. Level: Moderate Section: 1-6 Page: 13 87. Saving data to a hard drive is considered a(n) ___output___ operation. Level: Easy Section: 1-6 Page: 12 88. The ampersand is used to ___concatenate___ string literals, variables, and expressions in output statements. Level: Easy Section: 1-6 Page: 14 1 - 11 Chapter 1 – Input Process Output 89. A bug is another name for a programming ___error___. Level: Easy Section: 1-7 Page: 14 90. The ___Step Over___ option will execute the next command at the same level as the current command. Level: Hard Section: 1-7 Page: 14 Essay Questions 91. Explain the terms algorithm and syntax. How are they related? An algorithm represents the logical design of a solution used to solve a problem. It can be represented in many forms including a flowchart or pseudocode. The syntax represents the specific programming language and associated rules used to create or implement the logical design of the algorithm. Every programming language has its own unique syntax that must be followed. The algorithm and syntax together are used to create a computer program that will solve the problem in question. Using syntax to write a program without an algorithm as a guide can lead to a computer program that does not solve the problem. 92. What is an Information System? An Information System is used to collect, process, and output the data of an organization or individual. It includes both the people who design, create, and maintain the system as well as the computers and other technologies that are used to implement the system. All information systems will accomplish three fundamental tasks: Input: collect and gather data Process: organize and manipulate data to create information and knowledge Output: display information on screens and printed reports, store information for later retrieval 1 - 12