VB.NET PROGRAMMING

64
VB.NET PROGRAMMING VB.NET PROGRAMMING FINAL EXAM TEST REVIEW FINAL EXAM TEST REVIEW

description

VB.NET PROGRAMMING. FINAL EXAM TEST REVIEW. Chapter 1 Review. An Introduction to VB.NET and Program Design. Chapter One Review. Step-by-step series of instructions telling the computer what to do. A Program The process of writing these instructions is called what? Programming. - PowerPoint PPT Presentation

Transcript of VB.NET PROGRAMMING

Page 1: VB.NET PROGRAMMING

VB.NET PROGRAMMINGVB.NET PROGRAMMING

FINAL EXAM TEST REVIEWFINAL EXAM TEST REVIEW

Page 2: VB.NET PROGRAMMING

Chapter 1 ReviewChapter 1 Review

An Introduction to VB.NET An Introduction to VB.NET and Program Designand Program Design

Page 3: VB.NET PROGRAMMING

Chapter One ReviewChapter One Review

Step-by-step series of instructions Step-by-step series of instructions telling the computer what to do.telling the computer what to do.–A ProgramA ProgramThe process of writing these The process of writing these instructions is called what?instructions is called what?–ProgrammingProgramming

Page 4: VB.NET PROGRAMMING

Chapter One ReviewChapter One ReviewPeople who design and write programsPeople who design and write programs–Programmers or software Programmers or software

developersdevelopersA collection of one or more programsA collection of one or more programs–ApplicationsApplicationsThe process of writing applicationsThe process of writing applications–Program DevelopmentProgram Development

Page 5: VB.NET PROGRAMMING

What is What is Microsoft Visual Basic .NET?Microsoft Visual Basic .NET?

AA programming environment that allows you to programming environment that allows you to build programs for the Windows operating build programs for the Windows operating system or any system that supports system or any system that supports Microsoft’s .NET architecture.Microsoft’s .NET architecture.– VB.NETVB.NETVB.NET is based on the what programming VB.NET is based on the what programming langauge?langauge?– Visual Basic which evolved from BASICVisual Basic which evolved from BASICThe process of writing a program using a The process of writing a program using a programming language is called what?programming language is called what?– CodingCoding

Page 6: VB.NET PROGRAMMING

Programming and Programming and Application DevelopmentApplication Development

Store programStore programMachine Cycle Machine Cycle – how a computer – how a computer processes information -- 4 Steps!processes information -- 4 Steps!– FetchFetch– DecodeDecode– ExecuteExecute– StoreStore

Page 7: VB.NET PROGRAMMING

Application TypesApplication Types

Runs in a Windows Environment. Has a Runs in a Windows Environment. Has a user-interfaceuser-interface– Windows ApplicationsWindows Applications

Page 8: VB.NET PROGRAMMING

Application TypesApplication Types

Runs from your web browser. Converts Runs from your web browser. Converts the VB to HTML. Has a user-interface.the VB to HTML. Has a user-interface.– Web ApplicationsWeb Applications

Page 9: VB.NET PROGRAMMING

Application TypesApplication Types

Have a user-interface. Runs from a Have a user-interface. Runs from a command prompt.command prompt.– Console ApplicationsConsole Applications

Page 10: VB.NET PROGRAMMING

The Development CycleThe Development Cycle

Page 11: VB.NET PROGRAMMING
Page 12: VB.NET PROGRAMMING
Page 13: VB.NET PROGRAMMING

StoryboardStoryboard

Page 14: VB.NET PROGRAMMING

Chapter 2Chapter 2

The Visual Basic .NET The Visual Basic .NET Integrated Development Integrated Development

EnvironmentEnvironment

Page 15: VB.NET PROGRAMMING

Starting Starting Visual Basic .NETVisual Basic .NET

The part of the VB.NET application that The part of the VB.NET application that contains windows and toolbars that allow contains windows and toolbars that allow you to develop applications.you to develop applications.– Integrated Development Environment (IDE)Integrated Development Environment (IDE) A collection of code and other files that A collection of code and other files that usually encompasses one program.usually encompasses one program.– ProjectProject

Page 16: VB.NET PROGRAMMING

Chapter TwoChapter Two• When the IDE is in ________ _______, you

can make modifications to the forms and code of a program. • Design Time

• Displays the VB.NET menu names each of which represents a list of commands that you allow you to create, edit, save, print, test and run VB.NET applications.

• Menu Bar

Page 17: VB.NET PROGRAMMING

Chapter TwoChapter Two

Contain shortcuts to commonly used commands. Contain shortcuts to commonly used commands. Standard and Layout are two most popular Standard and Layout are two most popular toolbars.toolbars.

• Toolbars• A grouping of projects and related files. Solutions A grouping of projects and related files. Solutions

can contain one project, like this take-home pay can contain one project, like this take-home pay calculator, or many related projects, data files and calculator, or many related projects, data files and graphic files.graphic files.

• Solution

Page 18: VB.NET PROGRAMMING

Chapter TwoChapter TwoTo test a project you To test a project you __________________ it. This is usually it. This is usually done by clicking the start button on the standard done by clicking the start button on the standard toolbar.toolbar.– RUNRUNBy running your project during the development By running your project during the development phase, you can check for problems, or phase, you can check for problems, or ________________, , that you may have introduced into your code that you may have introduced into your code inadvertently.inadvertently.– BUGSBUGSThe process of getting your code to work as The process of getting your code to work as expected is known as expected is known as ________________________..– DEBUGGINGDEBUGGING

Page 19: VB.NET PROGRAMMING

Chapter TwoChapter TwoA characteristic or attribute of an object, such as its A characteristic or attribute of an object, such as its background color or the text that it displays. background color or the text that it displays. – PROPERTYPROPERTY

The The ____________________________ lists the attributes for the object lists the attributes for the object currently selected in the main work area.currently selected in the main work area.– PROPERTIES WINDOWPROPERTIES WINDOW

The Properties Windows has two parts:The Properties Windows has two parts:– __________ ________________ ______ -- displays the name of the currently -- displays the name of the currently

selected object or control.selected object or control.

OBJECT BOXOBJECT BOX– __________ _____________________ ___________ – displays the list of properties – displays the list of properties

associated with the currently selected object or control.associated with the currently selected object or control.

PROPERTIES LISTPROPERTIES LIST

Page 20: VB.NET PROGRAMMING

Chapter ThreeChapter Three

Building an Application in Building an Application in Visual Basic.NETVisual Basic.NET

Page 21: VB.NET PROGRAMMING

Chapter 3Chapter 3

Building an Application in the Building an Application in the Visual Basic .NET Visual Basic .NET

EnvironmentEnvironment

Page 22: VB.NET PROGRAMMING

Chapter ThreeChapter Three

The UI is the way the a program accepts data The UI is the way the a program accepts data and instructions from the user and produces and instructions from the user and produces results.results.– User InterfaceUser InterfaceA ___________________ provides visual cues A ___________________ provides visual cues such as a menu, a button, or small pictures such as a menu, a button, or small pictures (called (called iconsicons) to help the user enter data and ) to help the user enter data and give instructions to the computer.give instructions to the computer.– Graphical User Interface (GUI)Graphical User Interface (GUI)

Page 23: VB.NET PROGRAMMING

Chapter ThreeChapter ThreeA control is said to have _____________ when it is A control is said to have _____________ when it is selected on the screen. selected on the screen. – FOCUSFOCUS

Used to set the position where the application will Used to set the position where the application will display on run. display on run. – StartUpPositionStartUpPosition

Allows you to set the title for a form. Allows you to set the title for a form. – Text PropertyText Property

Controls the appearance of the border of a form.Controls the appearance of the border of a form.– FormBorderStyleFormBorderStyle

Sets the background and foreground colors for the Sets the background and foreground colors for the form.form.– Background and ForegroundBackground and Foreground

Page 24: VB.NET PROGRAMMING

Chapter ThreeChapter ThreeObjects that you can add to your form.They are found on Objects that you can add to your form.They are found on VB.Net’s ToolboxVB.Net’s Toolbox• CONTROLSCONTROLS

Displays text on the form that cannot be altered by the end Displays text on the form that cannot be altered by the end user.user.• LABEL CONTROLLABEL CONTROL

Displays text on the form that can be altered by end user.Displays text on the form that can be altered by end user.• TEXTBOX CONTROLTEXTBOX CONTROL

Used by the user to initiate actions called eventsUsed by the user to initiate actions called events..• BUTTON CONTROLBUTTON CONTROL

Used to display or allow users to enter numbers on a form. Used to display or allow users to enter numbers on a form. Cuts down on user’s ability to screw things up.Cuts down on user’s ability to screw things up.• NUMERIC UP DOWN CONTROLNUMERIC UP DOWN CONTROL

Page 25: VB.NET PROGRAMMING

Chapter ThreeChapter Three

Allows you to rename the object to something that Allows you to rename the object to something that makes more sense.makes more sense.• NameNameAllows you to change the words that show up on Allows you to change the words that show up on the control itself. (or on the title bar of the form!).the control itself. (or on the title bar of the form!).• TextTextMakes it impossible for the end user to edit the Makes it impossible for the end user to edit the text in that box.text in that box.• Read OnlyRead Only

Page 26: VB.NET PROGRAMMING

Chapter ThreeChapter ThreeAllows the programmer to control the order in which the Allows the programmer to control the order in which the control gets the focus when the user is tabbing.control gets the focus when the user is tabbing.• TAB INDEXTAB INDEX

Allows the programmer to have a control skipped during Allows the programmer to have a control skipped during tabbing.tabbing.• TAB STOPTAB STOP

NUMERIC UP/DOWN BOXESNUMERIC UP/DOWN BOXESDefines the current value displayed in the controlDefines the current value displayed in the control• VALUE PROPERTYVALUE PROPERTY

Allows the programmer to define the upper and lower Allows the programmer to define the upper and lower boundaries for the values in a NUD control.boundaries for the values in a NUD control.• MIN AND MAX PROPERTIESMIN AND MAX PROPERTIES

Page 27: VB.NET PROGRAMMING

CHAPTER THREECHAPTER THREE

Programmers often add comments within Programmers often add comments within their code as a form of internal their code as a form of internal documentation. These are known as:documentation. These are known as:• REM LINES or Comment StatementsREM LINES or Comment Statements

Each comment line must begin with an Each comment line must begin with an ____________________________ or the letters or the letters ____ ____ – – which is short for “remark”.which is short for “remark”.• APOSTROPHE OR REMAPOSTROPHE OR REM

Page 28: VB.NET PROGRAMMING

Chapter ThreeChapter Three

Messages sent to an objectMessages sent to an object• EVENTSEVENTS

Default event for buttons. Code will Default event for buttons. Code will execute when user Clicks on the button.execute when user Clicks on the button.• CLICK EVENTCLICK EVENT

Instructions to the computer written at Instructions to the computer written at design time for the computer to execute at design time for the computer to execute at run timerun time• CODE STATEMENTSCODE STATEMENTS

Page 29: VB.NET PROGRAMMING

Writing Code in the Code WindowWriting Code in the Code Window

An error caused by code statements that violate An error caused by code statements that violate one of the structure or syntax rules of the Visual one of the structure or syntax rules of the Visual Basic .NET languageBasic .NET language• SYNTAX ERRORSYNTAX ERROREvent procedures for controls start with the word Event procedures for controls start with the word __________________________ since the section is just for that since the section is just for that one control. one control. • PRIVATE SUBPRIVATE SUBThe line that begins The line that begins ________________________ indicates the indicates the end of a particular event procedure.end of a particular event procedure.• END SUBEND SUB

Page 30: VB.NET PROGRAMMING

CHAPTER FOURCHAPTER FOUR

Working with Variables, Working with Variables, Constants, Data Types and Constants, Data Types and

ExpressionsExpressions

Page 31: VB.NET PROGRAMMING

Chapter FourChapter Four

Presents a set of choices. Only one can be Presents a set of choices. Only one can be chosen at a time. Often placed in a group box.chosen at a time. Often placed in a group box.– RADIO BUTTONSRADIO BUTTONSProperty that keeps track of which radio button is Property that keeps track of which radio button is selected.selected.– CHECKED PROPERTYCHECKED PROPERTYAllows you to set a default button for a form.Allows you to set a default button for a form.– ACCEPTBUTTON PROPERTYACCEPTBUTTON PROPERTY

Page 32: VB.NET PROGRAMMING

Chapter FourChapter Four

Represents a location in computer Represents a location in computer memory that can change values as the memory that can change values as the code executes.code executes.– VARIABLEVARIABLERepresents a location in computer Represents a location in computer memory that cannot be changed during memory that cannot be changed during execution.execution.– CONSTANTCONSTANT

Page 33: VB.NET PROGRAMMING

Chapter FourChapter FourThe The ______________________ of a variable or constant of a variable or constant determines what kind of data it can store. determines what kind of data it can store. – DATA TYPEDATA TYPE

Name three common data types:Name three common data types:– INTEGER, DOUBLE, STRINGINTEGER, DOUBLE, STRING

There are rules to naming your variables:There are rules to naming your variables:– The name The name must begin with a letter, not a # !must begin with a letter, not a # !– The name The name cannot be more than 16,383cannot be more than 16,383 characters. characters. – The name The name cannot contain punctuation or blank cannot contain punctuation or blank

spacesspaces..

Page 34: VB.NET PROGRAMMING

Chapter FourChapter Four

Some variable Naming Conventions:Some variable Naming Conventions:

– Short Short == == shrshr– Integer Integer == == intint– Single Single == == sngsng– Double Double == == dbldbl– String String == == strstr– Object Object ==== objobj

Page 35: VB.NET PROGRAMMING

Chapter FourChapter Four

Keyword used to declare a variable.Keyword used to declare a variable.– DIMDIMRefers to a variables ability to be accessed Refers to a variables ability to be accessed throughout a program. It is defined by where the throughout a program. It is defined by where the variable is declared. variable is declared. – SCOPESCOPEVariable that are available to all the procedures Variable that are available to all the procedures on a given form.on a given form.– GLOBAL VARIABLESGLOBAL VARIABLES

Page 36: VB.NET PROGRAMMING

Chapter FourChapter FourPredetermined order for performing calculations within an Predetermined order for performing calculations within an expression.expression.– ORDER OF OPERATIONSORDER OF OPERATIONS

Arithmetic operators in Visual BasicArithmetic operators in Visual Basic– ^̂ -- used to raise the power of an exponent -- used to raise the power of an exponent– ** -- used to multiply two numbers -- used to multiply two numbers– // -- used to divide 2 #’s and return a decimal result -- used to divide 2 #’s and return a decimal result– \\ -- used to divide 2 #’s and return an integer result -- used to divide 2 #’s and return an integer result– MODMOD -- Used to divide 2 #’s and return only the -- Used to divide 2 #’s and return only the

remainderremainder– ++ -- used to sum 2 #’s -- used to sum 2 #’s– -- -- Used to subtract 2 #’s or indicate a negative -- Used to subtract 2 #’s or indicate a negative

valuevalue

Page 37: VB.NET PROGRAMMING

Chapter FourChapter Four

Functions that are built into .NET.Functions that are built into .NET.– INTRINSIC FUNCTIONSINTRINSIC FUNCTIONSThis is a financial function that will return the This is a financial function that will return the payment for a loan based on periodic, constant payment for a loan based on periodic, constant payments and a constant interest rate.payments and a constant interest rate.– PMT FUNCTIONPMT FUNCTIONFunction that allows the programmer to Function that allows the programmer to determine how the output will appear on determine how the output will appear on the screen.the screen.– FORMAT FUNCTIONFORMAT FUNCTION

Page 38: VB.NET PROGRAMMING

Chapter 5Chapter 5

Decision MakingDecision Making

Page 39: VB.NET PROGRAMMING

Chapter FiveChapter Five

Used in Windows applications to present Used in Windows applications to present lists of choices. Uses the prefix lists of choices. Uses the prefix cmb.cmb.– COMBO BOX CONTROLCOMBO BOX CONTROLUsed to build the list inside the combobox.Used to build the list inside the combobox.– ITEMS PROPERTYITEMS PROPERTYUsed when there are more than two options Used when there are more than two options in a decision making structure! in a decision making structure! – SELECT CASESELECT CASEProvides the ability to display a message to Provides the ability to display a message to the user in a pop-up window.the user in a pop-up window.– MESSAGE BOXMESSAGE BOX

Page 40: VB.NET PROGRAMMING

Chapter FiveChapter FiveWhen you add items to a ComboBox List VB.Net When you add items to a ComboBox List VB.Net assigns each one an unique assigns each one an unique index numberindex number. . The first item is assigned an index of The first item is assigned an index of 00; the second item ; the second item gets an index of gets an index of 11; and so on.; and so on.– For example: Index Numbers for Auto Loan ProgramFor example: Index Numbers for Auto Loan Program

A -- Excellent Credit Rating A -- Excellent Credit Rating = 0= 0B – Good Credit Rating B – Good Credit Rating = 1 = 1 etc …. etc ….

SelectedIndexSelectedIndex is the property that keeps track of what is the property that keeps track of what index number is currently being accessed.index number is currently being accessed.When When no itemno item is selected, the SelectedIndex property is selected, the SelectedIndex property is set to is set to -1-1. The following line of code would clear the . The following line of code would clear the ComboBox: ComboBox:

Page 41: VB.NET PROGRAMMING

If…Then…Else Structure

Select Case Structure

Page 42: VB.NET PROGRAMMING

Chapter FiveChapter Five

Used to execute one statement or another Used to execute one statement or another conditionally.conditionally.– IF THEN STATEMENTSIF THEN STATEMENTS– The condition follows The condition follows the keyword IFthe keyword IF– A A conditioncondition is made up of two expressions and a is made up of two expressions and a

relational (comparison) operatorrelational (comparison) operator.. Equal Equal == Less than or equal to Less than or equal to <=<=Less than Less than << Greater than or equal to Greater than or equal to >=>=Greater thanGreater than >> Not equal to Not equal to <><>

When you have an if…then within an if then!When you have an if…then within an if then!– NESTED IF THEN STATEMENTSNESTED IF THEN STATEMENTS

Page 43: VB.NET PROGRAMMING

Coding a Select Case StatementCoding a Select Case Statement

Page 44: VB.NET PROGRAMMING

Coding a Select Case StatementCoding a Select Case Statement

Page 45: VB.NET PROGRAMMING

Chapter FiveChapter Five

Used to combine two or more conditions in Used to combine two or more conditions in an expression. All parts must be true for an expression. All parts must be true for the True section of code to trigger! the True section of code to trigger! – AND LOGICAL OPERATORAND LOGICAL OPERATORFor example:For example:

If strGender = “M” If strGender = “M” AndAnd intAge < 12 Then intAge < 12 ThenMessageBox.Show(“Boys Little MessageBox.Show(“Boys Little

League”)League”)End ifEnd if

Page 46: VB.NET PROGRAMMING

Chapter FiveChapter Five

The process of adding strings together. It The process of adding strings together. It is performed with the ampersand [ &] is performed with the ampersand [ &] character.character.– CONCATENATIONCONCATENATIONThe The plus signplus sign ( (++) can be used instead of ) can be used instead of the (&) operator. Often times programmers the (&) operator. Often times programmers avoid the + sign since it is used in avoid the + sign since it is used in mathematical problems as well.mathematical problems as well.

Page 47: VB.NET PROGRAMMING

Chapter 6Chapter 6

Looping andLooping andMultiple FormsMultiple FormsTEST REVIEWTEST REVIEW

Page 48: VB.NET PROGRAMMING

QUESTION 1:QUESTION 1:

It’s possible to add anIt’s possible to add an iconicon to to your title bar by setting the your title bar by setting the form’s form’s ____________ ____________ property.property.

Answer:Answer:– ICONICON

Page 49: VB.NET PROGRAMMING

QUESTIONS 2 & 3:QUESTIONS 2 & 3:

Determines how items display in the Determines how items display in the ListView Control. ListView Control. ANSWER QUESTION 2:ANSWER QUESTION 2:– VIEW PROPERTYVIEW PROPERTYSwitch to __________ if you want multiple Switch to __________ if you want multiple columns to show up in the listview control.columns to show up in the listview control.ANSWER QUESTION 3:ANSWER QUESTION 3:– DETAILSDETAILS

Page 50: VB.NET PROGRAMMING

QUESTION 4:QUESTION 4:

Rather than having to code changes for Rather than having to code changes for the width, height, and location of every the width, height, and location of every control, VB.NET allows you to set a fixed control, VB.NET allows you to set a fixed location, or location, or __________________________, for controls , for controls to specified sides of a form.to specified sides of a form.

ANSWERANSWER– ANCHORANCHOR

Page 51: VB.NET PROGRAMMING

QUESTIONS 5 & 6:QUESTIONS 5 & 6:

Most .NET applications contain more than Most .NET applications contain more than one form. one form. ANSWER:ANSWER:– TRUETRUEIf the first form is used to launch the If the first form is used to launch the second form it is sometimes referred to as second form it is sometimes referred to as the the __________.__________.ANSWERANSWER– PARENTPARENT

Page 52: VB.NET PROGRAMMING

QUESTIONS 7 & 8:QUESTIONS 7 & 8:

The The ________________________________________________ is used is used in applications to allow a user to specify in applications to allow a user to specify one of two conditions, such as on or off, one of two conditions, such as on or off, yes or no, or true or false.yes or no, or true or false.ANSWERANSWER– CHECKBOX CONTROLCHECKBOX CONTROLDetermines whether the box is checked or Determines whether the box is checked or not. It’s either True or False.not. It’s either True or False.ANSWERANSWER– CHECKED PROPERTYCHECKED PROPERTY

Page 53: VB.NET PROGRAMMING

QUESTION 9:QUESTION 9:

Well, as is the case with all forms, the Well, as is the case with all forms, the Today’s Sales Entry Form is a Today’s Sales Entry Form is a ________________________, which means that an , which means that an instance of the class must be declared instance of the class must be declared before it can be used. This can be done before it can be used. This can be done with an with an __________________________________________________. . ANSWERANSWER– CLASSCLASS– OBJECT VARIABLEOBJECT VARIABLE

Page 54: VB.NET PROGRAMMING

QUESTIONS 10 & 11:QUESTIONS 10 & 11:

The The ______________________________________________ determines whether the determines whether the variable contains a complete instance of the object.variable contains a complete instance of the object. ANSWERANSWER– NEW KEYWORDNEW KEYWORD

If the New keyword is not used, then the variable is If the New keyword is not used, then the variable is declared for future use but no memory is set aside for declared for future use but no memory is set aside for the contents of the object.the contents of the object.If the New Keyword is used, the object is said to be If the New Keyword is used, the object is said to be _____________________ _____________________ and memory is set aside for a and memory is set aside for a complete copy of the object. You can’t use a new form complete copy of the object. You can’t use a new form until this is done.until this is done.AnswerAnswer– INSTANTIATEDINSTANTIATED

Page 55: VB.NET PROGRAMMING

QUESTIONS 12 & 13QUESTIONS 12 & 13If the If the ____________________________________ is used in a form’s code to open another form, then is used in a form’s code to open another form, then both forms still can receive focus and be accessed by the user. both forms still can receive focus and be accessed by the user. – This is called a This is called a ________________________________________ – meaning that the user can flip back and forth – meaning that the user can flip back and forth

between the forms.between the forms.ANSWERSANSWERS– Show() Method, modelessShow() Method, modeless

The The ____________________________________________ is used to open a is used to open a ________________ ________________ form. form. – This means that the user must complete the action on the modal form before they will be This means that the user must complete the action on the modal form before they will be

allowed to continue work on other forms.allowed to continue work on other forms.ANSWERS ANSWERS – Show Dialog(), modalShow Dialog(), modal

Page 56: VB.NET PROGRAMMING

QUESTION 14QUESTION 14

One of the most powerful aspects of One of the most powerful aspects of computer programming is the capability of computer programming is the capability of performing a set of operations repeatedly performing a set of operations repeatedly based on certain conditions.based on certain conditions.In programming, the process of repeating In programming, the process of repeating a set of instructions is known as a set of instructions is known as ____________________________..ANSWERANSWER– LOOPING OR REPETITIONLOOPING OR REPETITION

Page 57: VB.NET PROGRAMMING

QUESTION 15:QUESTION 15:

This statement repeatedly executes a series of statements This statement repeatedly executes a series of statements in the loop as long as the condition is true.in the loop as long as the condition is true.

ANSWER:ANSWER:– DO WHILEDO WHILE

Two examples: (one tests at the top of the Two examples: (one tests at the top of the structure, one tests at the bottom of the structure)structure, one tests at the bottom of the structure)

Do While intCount <=20Do While intCount <=20 DoDointCount = intCount +1intCount = intCount +1 intCount = intCount +1 intCount = intCount +1

LoopLoop Loop While intCount <=20Loop While intCount <=20

Page 58: VB.NET PROGRAMMING

QUESTION 16:QUESTION 16:

This statement loops until the condition becomes This statement loops until the condition becomes true. true. ANSWER:ANSWER:– DO UNTILDO UNTILTwo examples: (one tests at the top of the Two examples: (one tests at the top of the structure, one tests at the bottom of the structure, one tests at the bottom of the structure)structure)

Do Until intCount >= 20Do Until intCount >= 20 DoDointCount = intCount +1intCount = intCount +1 intCount = intCount +1 intCount = intCount +1

LoopLoop Loop Until intCount >= 20Loop Until intCount >= 20

Page 59: VB.NET PROGRAMMING

QUESTIONS 17 & 18:QUESTIONS 17 & 18:

AA __________________ __________________ is a group of one or is a group of one or more objects that can be accessed and more objects that can be accessed and operated on as a single entity. operated on as a single entity. ANSWER:ANSWER:– COLLECTIONCOLLECTION

VB.NET assigns an unique VB.NET assigns an unique ____________ ____________ to to each item in a collection. This comes in handy each item in a collection. This comes in handy when writing code for a ListView Control. when writing code for a ListView Control. ANSWERANSWER– INDEX NUMBERINDEX NUMBER

Page 60: VB.NET PROGRAMMING

QUESTIONS 20, 21 & 22:QUESTIONS 20, 21 & 22:____________________________________ – this property always displays as – this property always displays as the first column in the ListView Control. the first column in the ListView Control. If you have more than one column in a ListView control, If you have more than one column in a ListView control, a ________________ collection is created. a ________________ collection is created. Each Item and SubItem has an Each Item and SubItem has an ______________________________________ANSWERSANSWERS– TEXT PROPERTYTEXT PROPERTY– SUBITEMSSUBITEMS– INDEX PROPERTYINDEX PROPERTY

Page 61: VB.NET PROGRAMMING

QUESTION 23 & 24QUESTION 23 & 24

For ExampleFor ExamplelstTodaysSales.Items(1).Text = lstTodaysSales.Items(1).Text = ______________________________lstTodaysSales.Items(0).SubItems(2).Text = lstTodaysSales.Items(0).SubItems(2).Text = ________________

Page 62: VB.NET PROGRAMMING

QUESTIONS 25 & 26:QUESTIONS 25 & 26:Loop that has an automatic counter and condition built Loop that has an automatic counter and condition built in.in.ANSWER:ANSWER:– FOR …. NEXT LOOPFOR …. NEXT LOOP

List Three Benefits of For … Next Loops:List Three Benefits of For … Next Loops:ANSWER:ANSWER:– More efficient than a Do While LoopMore efficient than a Do While Loop– Easier to readEasier to read– Uses less memoryUses less memory– Faster executionFaster execution

Page 63: VB.NET PROGRAMMING

QUESTIONS 27 & 28:QUESTIONS 27 & 28:

The The ______________________________________ allows you to allows you to retrieve part of a string (from a larger string) retrieve part of a string (from a larger string) based on a start position and the number of based on a start position and the number of characters to retrieve.characters to retrieve.ANSWERANSWER– SUBSTRING METHODSUBSTRING METHODFor example: For example: – strExample = “Christy Garrett”strExample = “Christy Garrett”– strLastName = strLastName = strExample.Substring ( ___ , ___)strExample.Substring ( ___ , ___)ANSWERANSWER– (8, 7)(8, 7)

Page 64: VB.NET PROGRAMMING

STUDY, STUDY, STUDYSTUDY, STUDY, STUDY

THE TEST CAN BE TOUGH! MAKE THE TEST CAN BE TOUGH! MAKE SURE YOU READ OVER ALL OF YOUR SURE YOU READ OVER ALL OF YOUR NOTES!NOTES!