Sei sulla pagina 1di 4

1. You can you ___ in order to allow the user to browse and find a file at run-time.

The openFileDialog common dialog control 2. Which of the following will occur if you are opening a data file with the StreamReader object and the file does not exist? An exception will occur 3. What is the purpose of WriteLine in the following statement? phoneStreamWriter.WriteLine(nameTextBox.Text) 4. When reading data in a data file using the StreamReader object, the data will be read ____. In the order in which it was written 5. A _____ is a method that automatically executes when an object is instantiated. Constructor 6. A big advantage of OOP over traditional programming is ____. The ability to reuse classes. 7. Which is true for the New sub procedure (contructor) in a class? No two constructors in a class can have the same sequence of parameter data types 8. To see a schematic of a class definition you could use the. Class Diagram 9. To override a method, you must declare the original method with the _____ keyword and declare the new method with the Overrides keyword. Overridable 10. Which statement is true? A derived class inherits all of the properties of a base class. 11. Which of the following is false? The code, Private aBookSale As BookSale() creates an object. 12. _____ refers to the combination of characteristics f an object along with its behaviors. Encapsulation 13. To make sure that the programmer generated graphics on the form gets redrawn every time the form is rendered, place the code in the forms _____ event procedure. Paint 14. What is needed to add sound to your project? My.Computer.Audio.Play 15. The form you are designing requires a blue line graphic that is 10 pixels wide. What is the declaration statement for the Pen object? Dim bluePen as New Pen (Color.Blue, 10) 16. Which of the following lines of code could be used to display the current date as MM/DD/YY in a status bar? dateToolStripStatusLabel.Text = Now.ToShortDateString 17. If a form that needs to design requires a toolbar and status bar, what controls are needed to build the form? ToolStrip control and StatusStrip control

18. In order to make a form a MDI parent form in a project, you must set the ____ property to True? IsMdiContainer 19. The Timer component _____. All of the answers are correct 20. Which of the following actions can the MDI parents Windows menu perform? All the above 21. Which of the following will allow you to move controls across the screen? A Picturebox controls Setbounds method and a Timer controls Tick event 22. The ___ component can be used to validate user input. It will display a flashing icon and display a tooltip style message to the user. ErrorProvider 23. Display information in a StatusStrip control by adding a ToolStripStatusLabel object and then setting the ToolStripStatusLabels ____property. Text 24. The ____ property of a text box can be used to control the number of characters the user can type into the box. MaxLength 25. In the GUI convention of drag and drop, the ____ event fires when the user releases the mouse button over the target. DragDrop

2. Name and describe the logical element of a three tier information system application, giving examples to enforce your points. How is OOP used in a multitier system? 1. Presentation tier- refers to user interface, which in VB are the form, control and menus. 2. Business tier- Is a class or classes that handle the data, this tier can include validation, calculation, business logic and rules 3. Data tier- includes retrieving and storing the data in a database, this layer retrieves the data and passes the results to the Business tier, or takes data from the Business tier and writes them in the appropriate location. In a Multitier system every object is modular, robust and adaptable to make a complete system. Tiers can be swapped in and out of the system without affecting other tiers, object oriented are layered and are constantly being used in a multitier system. 3. Explain the graphic class in the .Net Framework. a) what are the general steps for drawing graphics with the windows .NET framework? Create a Graphics object to use as a drawing surface. Instantiate a Pen or Brush object to draw with. Call the drawing methods of the Graphics object. b) What events use e.graphic? c) What actions to a form cause the graphics to be drawn? What code will force the graphics to be drawn? You can use the forms Refresh method to force a Paint event to occur. d) What is the difference between the Fill and Draw graphic methods? Fill method will fill the interior of whatever the object is, Draw method will draw the object such as rectangle, pie, or line. e) Name and describe 2 methods found in the e.graphic class. What arguments are used? 4 a) By selecting the Timer component from the toolbox then drag and drop it into the component tray. b) Interval Property: value of 0 to 65535, millisecond values 1 = 1000 ms, value can be set at run time or design time Timers Enabled Property: property is used to enable/disable the timers Tick Event, The default value is false , so you must set it to true when you want to enable the Timer. c) The Tick Event, One firing of a Timer component; each time the interval passes, another Tick event occurs.

d) The timer is used to have an event occur at some interval without the user performing an action. An example would be for a GIF image change the screen. 6) Visual Studio can handle traditional text data using streams. What namespace has

streams? System.IO namespace How do we add this namespace to our form? You have to include an Imports statement at the top of the file, before the statement declaring the forms class. a) What is the role of dialog boxes in hailing text files? The main one to be used is the OpenFileDialog common dialog component to display the dialog box, and then use the objects FIleName property to open the selected file. The advantage of this is that the user can do this during Run Time. b) Describe and explain the steps used in VB.NET for writing data to a text data file. 1.Declare a new StreamWriter object, which also declares the name of the data file. 2. Use the StreamWriters WriteLine Method to copy the data to a buffer in memory.(a buffer is just a temporary storage location.) 3. Call the StreamWriters Close method, which transfers the data from the buffer to the file and releases the system resources used by the stream. To describe these review page 447 and 448 cause it was too long to type and theres various ways. c) Describe and explain the steps used in VB.NET for reading data from a text data file. 1. Declare an object of the StreamReader class. The constructor declares the filename and optional path. This statement opens the file so that you can read from it. 2. Use the ReadLine method to read the data. You may need to use a loop to retrieve multiple records. 3. When finished, close the stream using the StreamReaders Close method. To further explain review pg. 449 and 450 cause its long and theres a couple ways of doing it.

Potrebbero piacerti anche