Page 1
Test Bank For Starting out with Visual C#, 6th Edition by Tony Gaddis Chapter 1-15
Chapter 1: Answers to the Review Questions Multiple Choice 1. b 2. a 3. d 4. b 5. c 6. a 7. c 8. b 9. a 10. a 11. d 12. b 13. c 14. b 15. c 16. a 17. b 18. d 19. b 20. b 21 c 22. a 23. d 24. a 25. b 26. b 27. c 28. d 29. b 30. a 31. b 32. d 33. a 34. b 35. a 36. c True or False 1. False Copyright © 2020 Pearson Education, Inc.
Page 2 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.
True True False True False True False False False False True
Short Answer 1. Because without it, the computer could not run software. 2. A bit that is turned on represents 1, and a bit that is turned off represents 0. 3. A digital device 4. Keywords 5. mnemonics 6. A compiler is a program that translates a high-level language program into a separate machine language program. The machine language program can then be executed any time it is needed. An interpreter is a program that both translates and executes the instructions in a high-level language program. As the interpreter reads each individual instruction in the program, it converts it to a machine language instruction and then immediately executes it. Because interpreters combine translation and execution, they typically do not create separate machine language programs. 7. Operating system 8. Pseudocode is an informal language used to write out the steps of an algorithm. A flowchart is a diagram that graphically depicts the steps of an algorithm. 9. In a text-based environment, such as a command line interface, programs determine the order in which things happen. 10. A class specifies the data that an object can hold (the object’s fields and properties), and the actions that an object can perform (the object’s methods). 11. No, because C# provides only the basic keywords and operators that you need to construct a program. In addition to the C# language, you need the .NET platform. .NET is a collection of classes and other code that can be used, along with a programming language such as C#, to create programs for the Windows operating system. 12. (1) The Toolbox (2) The Designer window (3) The Solution Explorer (4) The Properties window 13. The Toolbox is a window that allows you to select the controls that you want to use in an application’s user interface. 14. You can access the documentation for Visual Studio by Clicking Help on the menu bar, and then selecting View Help. (Or, you can press Ctrl+F1, and then press V on the keyboard.) This opens the Visual Studio documentation website in your Web browser. 15. If Visual Studio is already running, you can perform the following steps to open an existing project:
Click File on the Visual Studio menu bar, then select Open, then select Project/Solution...
Copyright © 2020 Pearson Education, Inc.
Page 3
The Open Project window will appear. Navigate to the desired solution folder, select the solution file, and click Open.
In Visual C# Express, perform the following steps to open an existing project:
16.
Click File on the Visual Studio menu bar, then select Open Project... The Open Project window will appear. Navigate to the desired solution folder, select the solution file, and click Open.
Right-click Form1.cs in the Solution Explorer, and then click View Designer in the pop-up menu.
Exercises 1.
Decimal 11 65 100 255
Binary 1011 1000001 1100100 11111111
2.
Binary 1101 1000 101011
Decimal 13 8 43
3.
Here is an example: The ASCII codes for the name Marty are: M = 77 a = 97 r = 114 t = 226 y = 121
4.
a. b. c.
The three test scores It will add the three test scores, and divide the sum by three. It will display the result of the calculation performed in b.
Copyright © 2020 Pearson Education, Inc.
Page 4
Chapter 2: Answers to the Review Questions Multiple Choice 1. c 2. d 3. a 4. b 5. d 6. d 7. b 8. a 9. c 10. a 11. d 12. b 13. d 14. c 15. d 16. a 17. b 18. d 19. c 20. b 21. a 22. c 23. b 24. a 25. c 26. a 27. c 28. b 29. a 30. b 31. d True or False 1. False 2. True 3. True 4. True 5. False 6. True 7. True 8. True 9. True 10. True 11. False 12. True Copyright © 2020 Pearson Education, Inc.
Page 5 13. 14. 15. 16. 17. 18. 19. 20.
False True False False True True False True
Short Answer 1. A bounding box indicates that an object is selected and ready for editing 2. The mouse cursor becomes a two-headed arrow 3. An object’s properties 4. The left column shows the name of each property and the right column shows the value of each property 5. Select the form. Locate the form’s Text property inside the Properties window. Click inside the area that holds the Text property’s value, and use the Delete or Backspace key to delete the text. Type the new value in its place and press the Enter key. 6. (1) Using the mouse to drag the sizing handles on the form’s bounding box and (2) changing the width and height values of the Size property in the Properties window. 7. Position the mouse cursor inside the control, and when the mouse cursor becomes a fourheaded arrow, you can click and drag the control to a new location. 8. Select the Button control. Locate the button’s Text property inside the Properties window. Click inside the area that holds the Text property’s value, and use the Delete or Backspace key to delete the text. Type the new text in its place and press the Enter key. 9. The Form1.cs file contains code that is associated with the Form1 form. When you write code that defines some action related to Form1 you will write the code in this file. 10. Double-quotation marks 11. No, you cannot skip this step. When you double-click a control in the Designer, Visual Studio not only creates an empty event handler, but it also writes some code that you don't see, elsewhere in the project. This other code is necessary for the event handler to properly function. 12. Design time is the phase during which you create or modify the application. Run time is when the application is executing and it cannot be modified. 13. The Label control's text will have a recessed 3D appearance 14. The control automatically resizes itself to accommodate the size of the text it displays 15. TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, or BottomRight. 16. Assign an empty string to the control's Text property. 17. A PictureBox control can display images that have been saved in the bitmap, GIF, JPEG, metafile, or icon graphics formats. 18. Normal, StretchImage, AutoSize, CenterImage, and Zoom 19. Line comments, block comments, and documentation comments. 20. When you enter a statement into the editor, Visual Studio analyzes it, and if a syntax error is found, it is underlined with a jagged line. Algorithm Workbench 1. MessageBox.Show("Good Afternoon"); 2. MessageBox.Show("Kathryn James"); Copyright © 2020 Pearson Education, Inc.