The document describes the Visual Basic IDE and how it is used to develop applications. It discusses various form controls like labels, buttons, and radio buttons. It also covers topics like events, properties, and differences between design and run time. Code conventions and comments are explained. True/false questions test understanding of concepts like objects, events, and controls.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
406 views5 pages
Chapter 2 - Critical Thinking
The document describes the Visual Basic IDE and how it is used to develop applications. It discusses various form controls like labels, buttons, and radio buttons. It also covers topics like events, properties, and differences between design and run time. Code conventions and comments are explained. True/false questions test understanding of concepts like objects, events, and controls.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
Chapter 2 Critical Thinking
1) Describe how the windows, components, and the
features of the Visual Basic IDE are used to develop, run, and debug an application. Form - Graphical object that contains a title bar, system menu, minimize, maximize and close buttons. Toolbox - Contains controls used to add things to a form. Label Object- Displays text unchangeable by the user. Menustrip object - Displays a menu when the program runs, can be used to exit out and such. Radiobuttons - Allows users to choose from a set of options and shows other text when pressed. Buttons - Used to preform actions, can interact with labels and menu strips and such. Properties window - Lists properties of selected object, allows programmer to modify said object. Application - Consists of statements that are instructions for preforming tasks. Comments - Used to explain code for other programmers that want to help. 2) Indicate what would be displayed if each of these expressions where assigned to a label: a) 10 + 3 6 = 7 b) 2 ^ 3 + 5 * 4 = 28 c) 4 + 3 * 2 = 10 d) 2 + 9 ^ (1/2) = 6 e) 15 * 2 + 4 = 34 f) 15 * (2 + 4) = 90 g) 2 + 4 / 2 + 1 = 2 h) 5 3 ^ 2 + 1 = -3 i) 15 / 3 + 2 = 7 j) 6 + 3 2 = 6 + 3 2 k) 2 + 9 ^ = 5 l) 5 3 ^ (2 + 1) = -22 3) Explain the term eventdriven. Executes code in response to events, such as clicking, hovering, etc. 4) List the controls presented in this chapter and explain if and how the user can interact with each one. Buttons Push it to do a specific task, such as change text Label It is writing that you can change in font, size, and what is display with events. Group Box Put different objects inside of it so only one can be active at once Radio Buttons Basically a checkbox, runs code based on whichever was checked. Menu Strip Displays menus which can have sub menus, which can do many different things, just as close the form 5) List at least one difference in the way a form looks between the Design window and at run time. In design mode, the programmer can move things around and modify as wanted. While the program is running, you cant edit the form or code. 6) List two ways to terminate a running application. Code an exit command, or click the stop debugging button. 7) Explain the difference between the (Name) and Text properties of a control. The name refers to the name of the object in the code, whereas the text is the name it displays. 8) Why is it better to type the statement Me.lbl.Message.Text = Hello world! rather than just lbl.Message.Text = Hello world! That is because it is a code convention, where the Me is referring to an object assignment command. 9) Write the statements needed for the Click event procedures of radSum and radDifference base on the following application. Assume the first label is lblMessage and the second is lblResult: Sum= lblMessage.Text = "The sum of x and y is " lblResult.Text = 5 + 3 Difference= lblMessage.Text = "The difference of x and y is " lblResult.Text = 5 3 10) Explain the error(s) in the following comments: The date does not have a single quotation in front of it () and the display greeting code has a () in front of it, turning it in to a comment. 11) Determine if each of the following are true or false. If false, explain why. a) A Visual Basic application consists of a single file. False, it consists of several files for the program. b) A Windows application includes at least one form. True. c) The Text property of a form defines what is displayed in its title bar. True. d) The properties of an object can only be set in the Properties window. False, it can also be set at run time with an assignment statement e) Text displayed in a label can be changed by the user. False, the text is set by the programmer, and cant be changed by the user f) A MenuItem object can have a Click event procedure. True g) A MenuStrip component can have only one MenuItem object. False, it can have many. h) Each line of program code is called an object. False, A line of program is called a Statement i) Visual Basic is an object-oriented programming language. True. j) Program code is typed into the design window. False, Program code is typed in the Code Window, not the Design Window. k) Buttons in the Toolbox are used to switch between the Code and Design window. False, Buttons in the Solution Explorer Window are used to switch between code and design l) Click is an example of an event. True. m) Private indicates that a procedure can be accessed outside of the Form1 class. False, Private indicates that 1 or more declared programming element are only accessible from their declaration context n) Options displayed in an IntelliSense list vary depending on what is typed before the dot. True. o) An assignment statement is used to change a value at run time. True. p) More than one radio button in a set can be selected at a time. False, only one Radio Button can be selected at a time. q) The only purpose of a GroupBox object is to display the title for a set of RadioButton objects. False, GroupBoxes are used for grouping related radio buttons, GroupBoxes act as a sort of Caption and Border r) Comments affect the way an application runs. False, They just Explain and Clarify what the program code is/does s) Multiline comments are created by placing a question mark (?) at the beginning of each line. False, you use a single quotation mark at the beginning of each line t) Code conventions are a set of guidelines for writing an application. True.
Python Advanced Programming: The Guide to Learn Python Programming. Reference with Exercises and Samples About Dynamical Programming, Multithreading, Multiprocessing, Debugging, Testing and More