Starting Out with Visual C# 2012

Chapter 1 Introduction to Computers and Programming
Multiple Choice
1. A(n) ____________ is a set of instructions that a computer follows to perform a
task.
a. algorithm
b. program
c. formula
d. method
ANS: B
2. Programs are commonly referred to as ____________.
a. applications
b. simulations
c. software
d. firmware
ANS: C
3. A programmer, or software developer, is a person with the training and skills
necessary to ____________ computer programs.
a. design
b. create
c. test
d. All of the above
ANS: D
4. ____________ refers to all the physical devices, or components, of which a computer
is made.
a. Hardware
b. Workstation
c. Machine
d. System
ANS: A
5. When a computer is performing the tasks that a program tells it to do, we say that
the computer is running, or ____________ the program.
a. compiling
b. processing
c. executing
d. reading
ANS: C
6. The ____________ is the part of a computer that actually runs programs.
a. CPU
b. software
c. main memory
d. programming language
ANS: A
7. The ____________ is considered by many to be the world’s first programmable
electronic computer.
a. UNIVAC

b. ENIAC
c. Apple II
d. Harvard MARK I
ANS: B
8. Today, CPUs are small chips known as ____________.
a. parallel processors
b. microprocessors
c. mini-CPUs
d. super computers
ANS: B
9. ____________ is where the computer stores a program while the program is running,
as well as the data that the program is working with.
a. Main memory
b. Software
c. The CPU
d. Secondary storage
ANS: A
10.

Main memory is commonly known as ____________, or RAM.
a. random-access memory
b. read-append memory
c. random-asynchronous memory
d. readily-available memory
ANS: A

11.

When the computer is turned off, the contents of ____________ are erased.
a. secondary storage
b. RAM
c. software
d. hardware
ANS: B

12.
____________ is a type of memory that can hold data for long periods of time,
even when there is no power to the computer.
a. RAM
b. Secondary storage
c. Application software
d. Main memory
ANS: B
13.
A(n) ____________ stores data by magnetically encoding it onto a circular disk.
a. CPU
b. output device
c. program
d. disk drive
ANS: D
14.
A ____________ records data onto a small floppy disk, which can be removed
from the drive.
a. USB drive
b. hard drive
c. floppy disk drive

d. DVD
ANS: C
15.
____________ are small devices that plug into the computer’s USB port and
appear to the system as disk drives.
a. Virtual disk drives
b. Universal serial bus (USB) drives
c. Floppy disk drives
d. External disk drives
ANS: B
16.
The compact disk (CD) and digital versatile disk (DVD) are known as
____________ devices.
a. optical
b. binary
c. legacy
d. encoded
ANS: A
17.
____________ is any data the computer collects from people and from other
devices.
a. Telemetry
b. Input
c. Information
d. Storage
ANS: B
18.
The component that collects the data and sends it to the computer is called
a(n) ____________.
a. storage device
b. output device
c. sending unit
d. input device
ANS: D
19.
____________ is any data the computer produces for people or for other
devices.
a. Output
b. Software
c. Firmware
d. Media
ANS: A

20.
Data produced by the computer is sent to a(n) ____________, which formats
and presents it.
a. input device
b. output device
c. storage device
d. program
ANS: B

USB drive d. a. application software ANS: B 25. cells d. a. One ____________ is enough memory to store only a letter of the alphabet or a small number. bit b. output devices ANS: C 22. The software tools that programmers use to create. device drivers d. and test software are referred to as ____________. cell ANS: B . device driver c. application software b. Web browser ANS: C 23. byte c. sectors b. utility programs b. kernel b. operating system d. secondary storage device c.21. operating systems b. a. Programs that make a computer useful for everyday tasks are known as ____________. The programs that control and manage the basic operations of a computer are generally referred to as ____________. a. application software d. a. system software ANS: C 26. system software d. utility program b. bytes ANS: D 27. sector d. modify. RAM c. software development tools c. arrays c. a. utility programs c. A(n) ____________ performs a specialized task that enhances the computer’s operation or safeguards data. A computer’s memory is divided into tiny storage locations known as ____________. a. operating system ANS: A 24. A(n) ____________ is the most fundamental set of programs on a computer.

pixels c. 0 c. a. ANSI b. octal d.28. ANSEL d. The term bit stands for ____________. Unicode ANS: B . binary digit b. two’s complement c. a. a. Unicode c. bits d. Baudot code b. Unicode ANS: D 34. basic integer c. words ANS: C 29. -1 b. and other characters. big-endian format ANS: A 30. all numeric values are written as sequences of 0s and 1s. a. ASCII d. a. EBCDIC c. 255 d. ____________ is an extensive encoding scheme that is compatible with ASCII and can also represent the characters of many of the world’s languages. Each byte is divided into eight smaller storage locations known as ____________. a bit that is turned off represents the number ____________ and a bit that is turned on represents the number 1. a. nibbles b. various punctuation marks. binary ANS: D 32. 10 ANS: B 31. ____________ is a set of 128 numeric codes that represent the English letters. In computer systems. In the ____________ numbering system. decimal c. hexadecimal b. bit block transfer d. IEEE ANS: C 33. ASCII b. a. Computers are able to store negative numbers in memory by using a technique known as ____________. Boolean type d.

machine language ANS: D 42. a. decimal mode ANS: A 36. digital c. Before the computer can store a real number in memory. Digital data d. raster elements ANS: B 40. electronic b. pixels c. Bitwise data b. a. floating-point notation b. digital device c. binary machine d.35. a. a. A digital song is broken into small pieces known as ____________. computer ANS: B 37. assembly language d. light-emitting diodes d. Biometric data ANS: C 38. main memory b. samples c. A(n) ____________ is any device that works with binary data. hexadecimal c. A computer’s CPU can only understand instructions that are written in ____________. tones b. The entire set of instructions that a CPU can execute is known as the CPU’s ____________. it must be encoded in ____________. pentameters d. a. EBCDIC d. Digital images are composed of tiny dots of color known as ____________. a. Electronic information c. The term ____________ can be used to describe anything that uses binary numbers. organic d. halftone cells b. ____________ is data that is stored in binary. . electronic module b. mnemonics c. waves ANS: B 41. computational tool ANS: B 39. a.

a. mnemonic dictionary d. a. keywords c. code assembly process d. assembly language uses short words that are known as ____________. linked language ANS: B 48. instruction set b. assembly language d. operators d. compiler b. high-level language . A special program known as a(n) ____________ is used to translate an assembly language program to a machine language program. translator d. a. codex ANS: B 47. assembler b. command list c. machine-like language d. a. terms ANS: A 46. Instead of using binary numbers for instructions. a. mnemonics b. ready-set-go phase c. high-level language b. COBOL c. When a CPU executes the instructions in a program. A(n) ____________ allows you to create powerful and complex programs without knowing how the CPU works and without writing large numbers of low-level instructions. Because assembly language is so close in nature to machine language. Pascal ANS: C 45. assembler c. interpreter c. logic glossary ANS: A 43. fetch-decode-execute cycle b. it is referred to as a ____________.a. low-level language c. it is engaged in a process that is known as the ____________. FORTRAN b. compilation sequence ANS: A 44. ____________ was created in the early days of computing as an alternative to machine language. a.

Each programming language has its own ____________. commands c. The individual instructions that you use to write a program in a high-level programming language are called ____________. structure ANS: A 52. A(n) _____________ is a program that both translates and executes the instructions in a high-level language program. mnemonics c. grammar d. pseudonyms c. statements d. virtual language ANS: C 49.d. convention c. assembler d. a. syntax b. orders ANS: C 53. a. keywords b. compiler d. lexical analyzer ANS: B . which is a set of rules that must be strictly followed when writing a program. states d. directives b. interpreter c. A(n) ____________ is a program that translates a high-level language program into a separate machine language program. interpreter c. parser b. semantics ANS: C 50. compiler b. assembler ANS: C 54. a. The words that make up a high-level language are known as ____________ or reserved words. a. a. Programming languages have ____________ that perform various operations on data. a. mnemonics b. operators ANS: D 51. keywords d.

a. user interface ANS: D 59. which is also known as a console interface. or simply code. illegal operation ANS: B 57. or GUI. customer c. generic unified interface d. a. graphical user interface c. command prompt b. operating system b. A computer’s ____________ is the part of the computer with which the user interacts.55. user b. source code b. patient d. graphics utility interface ANS: B 61. high-level text c. terminal ANS: C 60. simple script ANS: A 56. a. Programmers commonly use the term ____________ to describe any hypothetical person that might be using a computer and its programs. a. allows the user to interact with the operating system and application programs through graphical elements on the screen. A(n) ____________ is a mistake such as a misspelled keyword. a. Because GUI programs must respond to the actions of the user. console c. code bug d. a missing punctuation character. monitor c. or the incorrect use of an operator. a. they are said to be ____________. The statements that a programmer writes in a high-level language are called ____________. syntax error c. Input device d. command line interface d. parsed anomaly b. general-purpose interface b. A(n) ____________. client ANS: A 58. A(n) ____________. requires the user to type commands. program font d. a. response-based .

a. A ____________ object displays text on a form. The data stored in an object are commonly called fields. The operations that an object can perform are called ____________. values ANS: C 64. attributes b. event-driven ANS: D 62. a. high-level ANS: A 63. drag-and-drop c. object-based c. or ____________. form object d. Character d. window object b. collective d. When you use a(n) ____________ language. properties d. you create programs by putting together a collection of objects. Label ANS: D 67. characteristics c. screen object c. a. a. Rectangle d. a. object-oriented b. actions b. a window that is displayed on the screen is called a ____________. Textbox c. A ____________ object appears as a rectangular region that can accept keyboard input from the user. In object-oriented programming. events c. open-ended d. True-type b. a. behaviors d. methods ANS: D 65. frame object ANS: C 66. Notepad ANS: B .b. Text b. Font c.

a. interactive c. blueprint d. . program development cycle c. Button b. When beginning a new programming project. understand the program’s purpose ANS: D 74. you can ____________. Frame ANS: A 69. MSDN Library b. A ____________object appears on a form as a button with a caption written across its face. correct syntax errors . Banner c. Checkbox d. a. Windows SDK ANS: B 72. a. a. diagram ANS: A 71. test the program and correct logic errors b. it is essential that you ____________. The entire process of creating a program is known as the ____________. a. along with a programming language such as C#. components ANS: C 70.68. write the program’s code d. Objects that are visible in a program’s graphical user interface are commonly referred to as ____________. opaque b. correct syntax errors c. a. a. design the program’s logic b.NET Framework c. class b. controls d. computer science sequence d. specification c. A ____________ is code that describes a particular type of object. Sync Framework d. to create programs for the Windows operating system. Once you clearly understand what the program is supposed to do. art of software development b. The ____________ is a collection of classes and other code that can be used. code-test-debug cycle ANS: B 73.

An algorithm that is written out in plain English statements is called ____________. output b. design the program’s logic ANS: C 75. processing c. are called ____________. schematic d.c. a. The ovals. processing symbols c. quick-code ANS: B 77. output c. terminal symbols d. outline ANS: C 76. input symbols b. prototyping b. output symbols ANS: C 79. a. flowchart b. flowchart b. outlining d. A ____________ is a diagram that graphically depicts the steps of an algorithm. design the program’s GUI d. a. End terminal d. which appear at the top and bottom of a flowchart. a. pseudocode c. schematic c. Start terminal ANS: D 80. a. a. billboard c. input b. formulaic hierarchy chart ANS: A 78. In a flowchart. A(n) ____________ is a set of well-defined. the ____________ symbol marks the program’s starting point. Input ANS: C . algorithm d. The ____________ symbol marks the program’s ending point in a flowchart. processing d. logical steps that must be taken to perform a task.

a. Visual Studio 2012 c. syntax error b. but also with other languages such as Visual Basic and C++. logic error c. ____________ are used as input symbols and output symbols to represent the steps in which the program reads input or displays output. a. A ____________ is a mistake that does not prevent the program from running but causes it to produce incorrect results. proofread c. Ovals b. The term ____________ means that the programmer finds and corrects logic errors in the program. integrated development environment (IDE) c. software development kit (SDK) ANS: B 86. In a flowchart. interpret error ANS: B 84. logistics ANS: A 85. debug b. output symbols c. testing. and debugging software. Parallelograms d. a. A(n) ____________ provides all the necessary tools for creating. A compiler c. processing symbols b. ____________ is a free programming environment that is available for download from the Microsoft Web site. super computer b. rectangles are used as ____________ to represent the steps in which the program performs some process on data. ____________ can be used to create applications not only with Visual C#. analyze d. a. Rectangles c. Visual Studio 2012 Express for Windows Desktop b. All of the above ANS: A 87.81. terminal symbols ANS: A 83. The MSDN library . a. Visual Studio 2012 b. In a flowchart. a. such as a mathematical calculation. parse error d. input symbols d. a. operating system d. Triangles ANS: C 82. Notepad d.

When the ____________ feature is turned on. command bar ANS: C 94. a. the window is displayed only as a tab along one of the edges of the Visual Studio environment. a. The ____________ window allows you to navigate among the files in a Visual C# project. Properties b. Designer d. Solution Explorer c. you use the ____________ window to examine and change a control’s properties. Internet Explorer ANS: A 88. When you are creating a Visual C# application. Pushpin c. Properties c. file c. The ____________ contains buttons that execute frequently used commands. hot bar c. Designer d. Each Visual C# application that you create is a called a ____________. project ANS: A 89. Source d. Economy View d. Solution Explorer b. Project ANS: C 90. . Properties b. standard toolbar d. solution b. Designer c. Auto Hide b. Tab ANS: A 93. a. Attributes ANS: A 92. Solution Explorer ANS: D 91. a. a. toolbox b. a. The ____________ is a window that allows you to select the controls that you want to use in an application’s user interface. source d. The ____________ window shows the application’s form and allows you to visually design its appearance by placing the desired controls that will appear on the form when the application executes.d.

solution file b. picker c. docked d. the ____________ contains various files related to the project. standard toolbar b. source folder d. a. system folder . docked ANS: A 98. system folder ANS: A 100. Inside the solution folder.a. When you create a new project using Visual Studio. A(n) ____________ is a small rectangular box that pops up when you hover the mouse pointer over a button on the toolbar or in the toolbox for a few seconds. A window that is not attached to one of the edges of the Visual Studio window is ____________. a. Solution folder b. a. it means it is attached to one of the edges of the Visual Studio window. System file ANS: A 99. project folder b. Message d. control library d. solution file c. a. it will be stored in the _____________ at the location you specify on your computer’s disk. Icon b. hovering c. seated c. you can double-click the ____________ to open the project in Visual Studio. a. ToolTip c. Alert ANS: B 96. a. parked b. Inside the solution folder. toolbox ANS: D 95. Project folder c. floating ANS: C 97. When a window is ____________. Solution file d. floating b. overlapped d.

Computer can do such a wide variety of things because they can be programmed. are inexpensive. Data is not recorded magnetically on an optical disc but is encoded as a series of pits on the disc surface. ANS: T 2. ANS: F 12. ANS: F 5. ANS: T 11. In addition to being much larger than the old electromechanical CPUs in early computers. microprocessors are also less powerful. ANS: T 8. RAM is usually a volatile type of memory that is used only for temporary storage while a program is running. project folder d. ANS: F 6. Programs are normally stored in main memory and loaded into secondary storage as needed.c. You can think of secondary storage as the computer’s work area. ANS: T 3. the computer could not run software. The most common type of secondary storage device is the disk drive. and small enough to be carried in a pocket. ANS: T 13. but to do any job that their programs tell them to do. ANS: T 10. . The use of USB drives has declined dramatically in recent years in favor of superior devices such as floppy disk drives. which means that computers are designed not to do just one job. ANS: T 4. RAM is stored in chips. A computer is not a single device but is a system of devices that all work together. The CPU is the most important component in a computer because without it. ANS: T 7. External disk drives can be used to create backup copies of important data or to move data to another computer. source file ANS: A True or False 1. USB drives. reliable. ANS: F 9. which are also known as memory sticks and flash drives.

Software development tools control the internal operations of the computer’s hardware. ANS: T 17. and data-backup programs. Unicode is quickly becoming the standard character set used in the computer industry. Web browsers. Floppy disk drives are good mediums for creating backup copies of data. ANS: T 24. ANS: T 23. e-mail programs. bits are tiny electrical components that can hold either a positive or a negative charge. There are two general categories of software: system software and application software. file-compression programs. In order to do anything meaningful. and game programs. . ANS: T 16. Common output devices are video displays and printers. ANS: T 19. In most computer systems. microphone. ANS: F 15. Examples of utility programs are virus scanners. and interpreters. and allow other programs to run on the computer. mouse. ANS: F 26. and digital camera. mange all the devices connected to the computer. The largest value that can be stored in a byte is 1. Common input devices are the keyboard. allow data to be saved to and retrieved from the storage devices. ANS: F 20. a computer has to have lots of bytes. ANS: T 18. ANS: T 25.ANS: T 14. ANS: T 21. An operating system consists of assemblers. Some examples of application software are spreadsheet programs. ANS: F 22. Any piece of data that is stored in a computer’s memory must be stored as a binary number. Disk drives and recordable optical disk drives can be considered input devices or output devices. scanner. ANS: T 27. compilers.

operators. A program is nothing more than a list of instructions that cause the CPU to perform operations. Each keyword in a high-level language has a specific meaning and cannot be used for any other purpose. ANS: T 34. ANS: T 29. Low-level languages allow programmers to concentrate on the tasks they want to perform with their program rather than the details of how the CPU will execute those programs. A programming statement can consist of keywords. ANS: F 32. The computer’s CPU is a brain. ANS: T 33. The binary numbering system can represent only integer numbers beginning with 0. ANS: T 30. ANS: F 35. ANS: F 31. The term pixel stands for picture element. The fewer samples that a song is divided into. ANS: T 38. It is impractical for people to write programs in a high-level language. the more it sounds like the original music when it is played back. and various punctuation characters must be used in a program. ANS: F 37. The syntax rules dictate how keywords. ANS: T . ANS: T 40. Computer’s can execute only programs that are written in assembly language. All programming languages have math operators that perform arithmetic. A machine language instruction exists for each operation that a CPU is capable of performing. ANS: F 36. punctuation. and other allowable programming elements. ANS: T 39. arranged in the proper sequence to perform an operation. and it is smart.ANS: T 28. operators.

When you write a program using a low-level language. If a program’s source code contains a syntax error. a window cannot float if its Auto Hide feature is turned on. it can be translated to machine language. an object is a physical device. ANS: T 53. An object must be created in memory before it can be used in a program. ANS: F 50. Most programming languages that are used today are object oriented. ANS: F 43.41. ANS: T 47. In software. ANS: F 46. all of the objects will be visible. such as a command line interface. you use objects to accomplish specific tasks. ANS: F 51. ANS: T 49. . the only way that the user could interact with a computer was through a command line interface. ANS: T 45. ANS: F 48. GUIs allow the user to point at graphical elements and click the mouse button to activate them. ANS: F 54. A class specifies the data that an object can hold. You must have a class for an object before it can be created in memory. ANS: F 55. In Visual Studio. In programming. an object has two general capabilities: it can store data and perform operations. ANS: T 52. they typically do note create separate machine language programs. but not the actions that an object can perform. In a text-based environment. ANS: F 42. Because compilers combine translation and execution. The C# language provides the classes and other code necessary for creating GUIs and performing many other advanced operations. When you are writing a program with a graphical user interface. ANS: T 44. For many years. the user determines the order in which things happen.

When a(n) ____________ appears around an object in the Designer. Editing .ANS: T 56. Labels. it indicates that the object is selected and is ready for editing. that object’s properties are displayed in the ____________ window. frame ANS: C 2. ANS: F Chapter 2 Starting Out with Visual C# 2012 Chapter 2 Introduction to Visual C# Multiple Choice 1. ____________ allow you to resize a selected object in the Designer by clicking and dragging the mouse when the mouse cursor becomes a two-headed arrow. When you select an object in the Designer. Flowcharting is a tool that programmers use to design programs. Bounding boxes b. bounding box d.NET framework provides classes to create Forms. The C# language allows you to write your own classes that have specific fields. ANS: F 59. ANS: T 61. Properties ANS: B 3. editing icon c. Designer b. Sizing handles c. The . A logic error is a mistake that prevents the program from running. and methods that you need for any situation. ANS: T 58. The process of creating a program that works correctly typically requires simply writing the code. Buttons. Virtually all code contains syntax errors when it is first written. TextBoxes. sizing handle b. ToolTips d. a. properties. and many other types of objects. a. ANS: T 60. a. ANS: T 57.

The ____________ property determines the text that is displayed in the form’s title bar. Toolbox d. a. a. Alphabetical ANS: D 7. Area b. Selecting the ____________ button in the Properties window causes the properties to be displayed in groups. Grouped b.c. hand icon d. Descending d. Type ANS: B 8. To delete a control. Rectangle ANS: C 6. You can click and drag a control to a new location when the mouse cursor is positioned inside the control and the mouse cursor becomes a ____________. Object d. The ____________ shows a scrollable list of controls that you can add to a form. a. The ____________ property can be used to change the form’s width and height in pixels. a. Resolution c. two-headed arrow b. scissor icon ANS: B 10. Arrange b. Shelf ANS: C 9. Collection b. select it on the form and then press the ____________ key on the keyboard. Ordered d. Text ANS: D 5. Bank c. Categorized c. Caption c. four-headed arrow c. a. When selected. the ____________ button causes the properties in the Properties window to be displayed in alphabetical order. . Size d. Title b. Properties ANS: D 4. a. Name d. Ascending c.

printSalesReportButton c. Button controls have a ____________ property. Control names are also known as ____________. delete Record Button ANS: A 16. a. Which one of the following Button control names is not a legal C# identifier? a. The ____________ naming convention gets its name because the uppercase characters that appear in a name are sometimes reminiscent of a camel’s humps. Which one of the following Button control names is a legal C# identifier? a. Z c. Name ANS: D 13. tags b. Tab d. identifiers c. a. Pascal c.a. camelCase b. which holds the text that is displayed on the face of the button. 1stPlayerStartButton ANS: D 15. X ANS: A 11. A control’s ____________ property identifies the control in the application’s code and in the Visual Studio environment. Text b. a. Delete b. labels ANS: B 14. Name c. CaMeL style ANS: A . _DisplayOption5Button b. Exit!Button c. Source c. values d. Description d. *Clear*Button* d. a. Text b. Tag d. _calculateTotalButton b. clear_customer_names_button d. Hungarian notation d. Face ANS: A 12.

cs d. Source. a. Window.cs b. method b. Main. which executes when the application runs. Pseudocode d. it is traditional to start by learning to write a ____________ program. namespace d. The ____________ file contains the application’s start-up code. a. K&R Style ANS: B 18. Form1. a. Hello World c.cs ANS: A 22. a. Simple b.cs ANS: C 21. To run an application in Visual Studio. Tab d. a. a. namespace c. F5 c. MainForm.cs d. source code file b. press the ____________ button on the keyboard or click the Start Debugging button on the toolbar. When a student is learning computer programming.cs c.cs b. queue d. Enter b. program c. cs file ANS: A 20. The ____________ file contains code that is associated with the Form1 form. class ANS: D . A(n) ____________ is a container that holds methods (among other things). event b. Control. list ANS: C 23. Program. A file that contains program code is called a ____________. a. A ____________ is a container that holds classes. C# file d. Code.cs c. program file c.17. Shift ANS: B 19.

bounding box ANS: B 28. a. namespace ANS: B 25. namespace c. such as namespaces. The series of ____________ directives that appears at the top of a C# source code file indicate which namespaces in the . include b. action sequencer b. a. tab c. button d. To switch between the Designer and the code editor. a. a. feature coordinator c. Action b. public d. braces ({}) b. A(n) ____________ event occurs on a control when the user clicks the control while the program is running. incident manager ANS: C 29. brackets ([]) e. algorithm b. a. ANS: A 27. A ____________ is a small window. method c. message box .24. Mouse ANS: B 30. sometimes referred to as a dialog box that displays a message. A(n) ____________ is a group of one or more programming statements that performs some operation. A(n) ____________ is a method that executes when a specific event takes place while an application is running. icon b. parentheses (()) d. pop up c. Live d. Code containers. standard window b. and methods. a. asterisks (**) c. classes. Click c. you simply click the ____________ for the desired window. a. use ____________ to enclose code. banner d.NET Framework the program will use. using ANS: D 26. class d. event handler d.

it is called a ____________. sentinel c.ANS: D 31. method call ANS: D 32.show(Hello) ANS: B 33. thread c. literal ANS: D 37. event handler b. a. Just as a period marks the end of a sentence. Messagebox("Hello") b. a. a. string ANS: D 34. If you want to execute a method. it is called a(n) ____________. you write a statement known as a(n) ____________. constant b. semicolon d. In C# code. value d. single quotation marks b. c. word d. In programming we use the term ____________ to mean string of characters. semicolons ANS: B 35. . space b. Which one of the following statements would correctly display the text “Hello” in a message box? a. a ____________ marks the end of a programming statement in C#.Show("Hello"). MessageBox. When a piece of data is written into a program’s code. statement b. When a string is written into a program’s code. ____________ are required to indicate the beginning and the end of a string. parentheses d. underscore c. d. double quotation marks c. a. initialization routine d. executor statement c. a. period ANS: C 36. msgbox. msgbox(Hello).

encoded string d. a. execution c. typed string c. Text c. When you have a project open in Visual Studio. Font d. Text designer b.a. run time d. prototyping b. a. up time b. The time during which an application is executing is referred to as ____________. Text control d. Containers c. Font control ANS: B 41. string constant ANS: A 38. design time c. Appearance b. Font dialog box c. The ____________ property allows you to set the font. Text editor d. font style. application progression ANS: B 39. The ____________ can be accessed in the Properties window by clicking the ellipses that appears next to the Font property’s value. a. Data d. a. and size of the control’s text. the time during which you build the GUI and write the application’s code is referred to as ____________. a. When you want to display text on a form. visual planning d. string literal b. Components ANS: A 42. Font selector ANS: B . String control b. The Label control can be found in the ____________ group of the Toolbox. Common Controls b. a. instancing ANS: C 40. Graphics ANS: C 43. Label control c. you use a ____________.

Redraw ANS: B 47. Toggle ANS: A 48. a. equality operator b. FixedDouble ANS: D 46. you use a(n) ____________ to store a value in a control’s property. a. the equal sign (=) is known as the ____________. a. DisplayFont c. FixedSingle b. None c. Fixed3D d. TextPosition b. TextAlign d. a. Binary c. Which one of the following is not a valid setting for a Label control’s BorderStyle property? a. dialog box d. GroupFont ANS: C 49. In C#. string literal b. constant ANS: B 50. Locked d.44. A ____________ property can be set to one of two possible values: True or False. Label controls have a(n) ____________ property that controls the way they can be resized. Border b. A Label control’s ____________ property can be used to align the text differently within the label. AutoSize c. In code. Singular d. Resize b. assignment operator . assignment statement c. FrameStyle c. Frame d. Boolean b. BorderStyle ANS: D 45. a. parity operator c. Label controls have a ____________ property that allows you to display a border around the control’s text. a.

d. outputLabel. Display ANS: B 57. cityLabel. c. ControlName. Picture b. ____________ is a feature of Visual Studio that provides automatic code completion as you write programming statements. DisplayMode b. cityLabel. Snippet d.Text = "clear". Which of the following statements would clear the text that is displayed in a Label control named cityLabel? a. a. c. You can use a(n) ____________ control to display a graphic image on a form. cityLabel. b. outputLabel. Which of the following statements would display the number 25 in a Label control named ouputLabel? a. d. Texture2D d. ControlName->PropertyName c. Once you have created a PictureBox control. Image b. Visible . Image c. transfer operator ANS: C 51.PropertyName b. a.Text = "".Text = "25". PictureBox ANS: D 56. a. outputLabel = "25".Text = 25. outputLabel(25). IntelliSense b. Source d. ControlName::PropertyName d. b. you use its ____________ property to specify the image that it will display. ANS: B 53. cityLabel. CodeHelper ANS: A 55. a. Graphics c. The PictureBox control’s ____________ property specifies how the control’s image is to be displayed. AutoComplete c.Text = "none".Text = "empty". d. ControlName<PropertyName/> ANS: A 52. ANS: D 54. The standard notation for referring to a control’s property in code is: a.

StretchImage ANS: B 59. Normal b. profilePictureBox. Comments . profilePictureBox. CenterImage d.Visible = false. profilePictureBox. Aspect ratio d.Invisible = True. StretchImage ANS: B 61. Invisible c. Assuming an application has a PictureBox control named profilePictureBox.c. Sketches b. Most controls have a(n) ____________ property that determines whether the control is visible on the form at run time. ____________ is a term that refers to an image’s width to height ratio. explaining how those parts of the program work. UV map ANS: C 60. a. which one of the following assignment statements will hide the PictureBox at run time? a.Visible = False. When a PictureBox control’s SizeMode property is set to ____________. Normal c. a. a. ____________ is the default value of the PictureBox control’s SizeMode property. Enabled b. Bounding box c. Visible ANS: D 62. b.Invisible = true. a. d. Tags c. Zoom c. Area b. the image is uniformly resized to fit the PictureBox without losing its original aspect ratio. SizeMode d. Show d. c. Zoom d. ____________ are short notes that are placed in different parts of a program. Render ANS: C 58. AutoSize b. profilePictureBox. a. ANS: B 63.

d. documentation comment ANS: A 65. line comment b. line comment b. ANS: B 69.Exit(). ____________ are used by professional programmers to embed extensive documentation in a program’ source code. ASCII art ANS: C 68. crossed out d.Stop(). short comment c. blank lines and indentations d. a. it is ____________. A(n) ____________ can occupy multiple consecutive lines in a program and starts with /* (a forward slash followed by an asterisk) and ends with */ (an asterisk followed by a forward slash). block comment d. a. Labels ANS: C 64. automatically corrected b. When you enter a statement into the code editor. Documentation comments d. A(n) ____________ appears on one line in a program and begins with two forward slashes (//).Quit(). Block comments c. c. a.d. me. Embedded comments ANS: C 67. a. documentation comment ANS: B 66. highlighted ANS: B .Close(). a. Visual Studio analyzes it. Programmers commonly use ____________ in their code to create a sense of visual organization. and if a syntax error is found. different font colors b. To close an application’s form in code. b. a. short comment d. documentation comments c. this. app. block comment c. you use the statement ____________. Line comments b. underlined with a jagged line c. form.

ANS: T 6. Deleting a control is simple: you select it and then press the F4 key on the keyboard. ANS: T 4. ANS: T 3. The appearance and other characteristics of a GUI object are determined by the object’s properties. The Properties window contains a scrollable list of properties. ANS: T 2. they are automatically given default names such as button1. ANS: F 5. and so forth. it cannot be deleted. Once a control has been added to a form. Crash pop up c. Debug dialog box b. When you create Button controls. The text that is displayed on a button should indicate what the button will do when it is clicked. ANS: T 11. ANS: F 10. You cannot click and drag controls from the Toolbox onto the form.70. button2. The ____________ shows a description of the error. and the name of the project. When Button control is created. ANS: T 7. the source code file that contains the error. a. ANS: F 8. Just In Time debugger True or False 1. you simply find it in the Toolbox and then double-click it. Changing the form’s Text property will change the form’s name. and the right column shows each property’s value. To add a control to a form. The properties in the Properties window are displayed alphabetically by default. ANS: F 9. its Text property is initially set to the same value as the Button control’s name. Error List window d. which has two columns: the left column shows each property’s name. ANS: T 12. the line number and column number of the error. . Each form and control in an application’s GUI must have a name that identifies it.

The . Each opening brace ({) of a code container must have a corresponding closing brace (}) at some later point in the program. which are contained inside methods. ANS: T . ANS: F 23. classes. ANS: F 15. and methods.cs file contains auto-generated code that serves as an outline to which you can add your own code as you develop the application.Show that you can use in Visual C# to display a message box. A control’s name should reflect the purpose of the control. ANS: T 17. A Hello World program is a simple program that merely displays the words “Hello World” on the screen. C# identifiers can contain spaces after the first character. ANS: T 22. ANS: T 25. ANS: T 19. which are contained inside classes. ANS: F 18. C# code is organized as namespaces. it doesn’t do anything until you add your own code. ANS: F 21. When an event handler is generated for a control by Visual Studio. C# code is primarily organized in three ways: namespaces. You can detach the code editor and move it to another part of the screen. C# source code files always end with the . It is important that you do not modify the contents of the Form1.cs file because doing so could prevent the application from executing.NET Framework provides a method named MessageBox. ANS: F 20. ANS: T 24. The first character of a C# identifier must be one of the letters a through z or A through Z or an underscore character (_). ANS: T 16. The only way to run a program in Visual Studio is by clicking the Start Debugging button on the toolbar.cs extension. ANS: T 26.ANS: T 13. The Program. ANS: T 14.

In a C# application. ANS: F 31. it is not necessary to double-click the control in the Designer first. The terms run time. the code editor. During design time. ANS: T 36. string literals must be enclosed in double quotation marks. ANS: T 38. you can interact with the running application. all the buttons on a form must share the same Click event handler in form’s source code file. runtime. ANS: F 33. ANS: F 34. ANS: F 29. ANS: F 35. Once you have placed a Label control on a form. ANS: T 37. but you cannot use the Designer. the Toolbox. To change the BorderStyle property of a Label control in the Designer. ANS: F 30. ANS: T . A Label control’s Text property is initially set to the same value as the Label control’s name. Programmers sometimes say that literals are values that are soft coded into a program because the value of a literal can be changed while the program is running.27. and run-time all typically mean the same thing. A control’s name should never be changed to something other than the default name that Visual Studio gives it. the Properties window. or parts of Visual Studio to make changes to it. ANS: T 32. If you wish to create a Click event handler for a control in Visual Studio. Ending a programming statement with a semicolon is not required in C#. you set its Text property to the text that you want to display. ANS: F 39. In C#. Double quotation marks are not required in code to mark the beginning and the end of a string. Programmers refer to the act of executing a method as calling the method. select it in the Properties window and then click the down-arrow button that appears next to the value. ANS: T 28.

When you use the Properties window to change a control’s Visible property at design time. the statements in the method execute in the order that they appear. if you want to clear the text that is displayed in a Label control. a Label control’s text is aligned with the top and left edges of the label’s bounding box. ANS: T 45. ANS: T 44. ANS: T 46. ANS: F 42. ANS: F 48. you can press the Tab key on the keyboard to accept suggestions made by the IntelliSense feature of Visual Studio. the control will become invisible in the Designer. ANS: T 53. In the Designer. ANS: T 47. By default. ANS: T 41. Because the Label control’s Text property can accept strings only. When typing a statement in code. ANS: F 51. When you write the values true or false in code. they must be written in all lowercase letters. simply assign an empty string ("") to the control’s Text property. from the beginning of the method to the end of the method. ANS: F 50. When a method executes. The assignment operator assigns the value that appears on its left side to the item that appears on its right side. Buttons are the only controls that can respond to Click events.40. ANS: F 43. but it does not work like a Label control’s BorderStyle property. the PictureBox control is automatically resized to fit the image that will be displayed. A control’s Visible property cannot be modified in code. When the PictureBox control’s SizeMode property is set to AutoSize. PictureBox controls have a BorderStyle property. ANS: F . Comments are short notes that are intended for the compiler. the PictureBox tool is located in the CommonControls group of the Toolbox. ANS: T 52. you cannot display a number in a label. ANS: F 49. In code.

and documentation comments. Block comments make it easier to write long explanations because you do not have to mark every line with a comment symbol. A line comment does not have to occupy the entire line. block comments. and namespaces is a convention that virtually all programmers follow. The standard Windows close button is the only way to close an application you create with Visual Studio. the code editor will highlight the code that caused the error. Writing comments should be avoided. classes. ANS: T 59. ANS: T 55. ANS: T 56. ANS: F 58. In C#. The indentation of statements inside methods. so a line comment can appear after an executable statement. ANS: T . ANS: F 60. ANS: T 57. there are three types of comments: line comments. If you double-click the error message that is displayed in the Error List window.54. especially for large and complex programs.