Visual Basic Coding Standards 1. Project Performance a) Project works according to specifications. - Your project must follow the requirements outlined in the textbook assignment as well as any additional requirements assigned by your instructor. b) Output is accurate. - It is not enough to just produce output (displayed or printed). Your output must be complete and 100? percent accurate. c) Logic is efficient| - Use the most efficient logic that the textbook or your instructor has covered. Examples: Declare and use appropriate variables for calculations. Use With/End With rather than repeat an object name. Use Select Case rather than If...Then...Else when appropriate. d) Meets all requirements. - Follow any special rules and requirements of the specification or your instructor. 2. Project submission a) Folder name and file names include your name or initials. - All the folder and executable names will be unique when instructor downloads them for evaluation. b) Zipped (compressed) Folder contains all necessary project files. (no extra files) - A compressed folder was created specifically for this project. The folder must contain all of the project's files. Files urrelated to the project should be moved or deleted. c) Project runs as submitted - Make sure that the project compiles and runs correctly from the folder that you submit. Problems can occur when any of the project's files are not stored in the project's folder. If your project cannot locate a renuired file- your project will not run! - Test the project, make sure to test it on a computer other than the one on which you wrote it. 3. User Interface a) Professional appearance Layout, placement, spelling - Designing the user interface is a critical component in the project's construction. Anything that will appear on the screen for the user (forms, message boxes, etc.) must be presented in a professional format. The screen design should be easy to understand and "comfortable" for the user. - Use correct spelling and punctuation. - Name the form and change the Text property. The Text property appears in the form's title bar. - Set the StardPosition and Windorsitate properties to determine where how your form will appear. - Make sure that any text on the form displays completely, during both design time and run-time. b) Follows Windows standards - Follow industry standards in relation to color, size, and placement of controls. (Refer to Chapter 2, "Designing the User Interface".) Keyboard access keys ( \& in Text property, AcceptButton. CancelButton set) - Use keyboard access for all buttons and menus. For some assignments, you will also be required to include access keys for text boxes, radio buttons, and check boxes. - Follow industry standards whenever possible- use the X of Exit, and the S of Save. - Do not give two controls the same access key. - Set one button as the AccertButtong (it will respond when the user presses the Enter key) and set one button as the CancelButton (it will respond when the user presses the ESC key). Be aware that some users are accustomed to pressing the Enter key instead of using the Tab key to jump to the next field. Tab order is correct. - Make sure the focus is on the correct object when a form displays. The tab order must proceed correctly when the user presses the Tab key. 4. Standards and conventions a) Object names - Do not keep the default names assigned by Visual Basic, such as Buttonl and Label3. The exception to this rule is for labels that never change during project execution. These labels usually hold items such as titles, instructions, and labels for other controls. - Use good, consistent names for objects. - Use camel casing and end each name with the class of the object. - Object names with multiple words should have the first character of each word capitalized. Examples: - Do not name your objects with numbers. - Object names must begin with a letter or an underscore. The name can contain letters, digits, and underscores. An object name cannot include a space or punctuation mark and cannot be a reserved word. b) Identifiers for Variables and Named Constants - Follow the textbook's standards and conventions when naming (identifying) your variables and constants. - Variables: Identifiers must be meaningful. Do not abbreviate unless the meaning is obvious and do not use very short identifiers, such as X or Y. Include the class (data type) of the variable. Begin with a lowercase letter and then capitalize each successive word of the name. Example: FirotidameString CustomerAgeInteger - Constants: The name portion should be entirely in uppercase, with multiple words separated by underscores. - Identifiers for variables and named constants may consist of letters, digits, and underscores. They must begin with a letter, they cannot contain any spaces or periods or be reserved words. Reserved words are words to which Basic has asigned some meaning, such as print, name, and value. c) Option Strict On / All variables declared - In VB_NET, Option Explicit is turned on by default. The best practice is to turn on Option Strict either in code or in the Proient Designer. Make sure the Option Strict On statement appears above the Public Class statement. If Option Strict is tumed on, variables must be declared, regardless of the setting of Option Explicit - Declare local variables at the top of a procedure, below the remarks. - Declare module level variables and constants in the Declarations section. d) Remarks in the Declarations section - Include the following information at the top (Declarations section) of every form in your project: Project name Date Programmer Name Program Description e) Descriptive remarks in every procedure - Write remarks describing the purpose of the procedure at the top of every procedure. Use onmect spelling and punctuation in all remarks. f) Proper indentation - Follow the textbook coding conventions and indent all lines in sub procedures and sub functions. - Do not indent the lines in the Declarations section of a form. - Indent all lines inside If Then/Else, With/End With, For/Next, For/Each, Do/Loop, Select Case, Type/End Type, Try/Catch for readability. Examples: If tot:Name.Text ?" Then
Chapter Three Programming Assignment \#1 Due Wednesday by 11:59pm Submitting a file upload Programming Project \#1 (Calculator) at the end of Chapter Three in the text. Design, develop, and test the program following the Coding Standards provided online in Canvas. Once completed and tested, archive your entire Visual Basic Project Folder into a single Zip archive and attach and submit your work in Canvas. This is a Homework assignment that will count as such towards your final grade. TG
Chapter Three Programming Assignment \#1 Due Wednesday by 11:59pm Submitting a file upload Programming Project \#1 (Calculator) at the end of Chapter Three in the text. Design, develop, and test the program following the Coding Standards provided online in Canvas. Once completed and tested, archive your entire Visual Basic Project Folder into a single Zip archive and attach and submit your work in Canvas. This is a Homework assignment that will count as such towards your final grade. TG
Else txtidame.Text = "Hello there, " \& trtName Text trothestrage Text = "Tell me who you are." End If With FontDialog 1 Font = tsthersagge Font. Shourialog: txtherisage Eont = Font End With For CounterInteger =1 to 100 If CounterInteger = MatchInteger Then End If trflMersige Text = "Match found at line number " \& CounterInteger Next Try QuantitvInteger = Integer.Parse(textQuantitx.Text) testQuantitis.Test = QuantityInteger ToStringO Catch TheException as ForratException End Try lines it one blank line after the remarks at the top of each procedure. rt one blank line after the declarations for variables and constants. it one blank line between procedures. rocedures included an up! Delete any procedures that do not contain code.
1. Calculator Write a program that allows the user to specify two numbers and then adds, subtracts, or multiplies them when the user clicks on the appropriate button. The output should give the type of arithmetic performed and the result. See Fig. 3.61. Note: When one of the numbers in an input text box is changed, the output text box should be cleared. Figure 3.61 Possible outcome of Programming Project 1.
Else txtidame.Text = "Hello there, " \& trtName Text trothestrage Text = "Tell me who you are." End If With FontDialog 1 Font = tsthersagge Font. Shourialog: txtherisage Eont = Font End With For CounterInteger =1 to 100 If CounterInteger = MatchInteger Then End If trflMersige Text = "Match found at line number " \& CounterInteger Next Try QuantitvInteger = Integer.Parse(textQuantitx.Text) testQuantitis.Test = QuantityInteger ToStringO Catch TheException as ForratException End Try lines it one blank line after the remarks at the top of each procedure. rt one blank line after the declarations for variables and constants. it one blank line between procedures. rocedures included an up! Delete any procedures that do not contain code.
Visual Basic Coding Standards 1. Project Performance a) Project works according to specifications. - Your project must follow the requirements outlined in the textbook assignment as well as any additional requirements assigned by your instructor. b) Output is accurate. - It is not enough to just produce output (displayed or printed). Your output must be complete and 100? percent accurate. c) Logic is efficient| - Use the most efficient logic that the textbook or your instructor has covered. Examples: Declare and use appropriate variables for calculations. Use With/End With rather than repeat an object name. Use Select Case rather than If...Then...Else when appropriate. d) Meets all requirements. - Follow any special rules and requirements of the specification or your instructor. 2. Project submission a) Folder name and file names include your name or initials. - All the folder and executable names will be unique when instructor downloads them for evaluation. b) Zipped (compressed) Folder contains all necessary project files. (no extra files) - A compressed folder was created specifically for this project. The folder must contain all of the project's files. Files urrelated to the project should be moved or deleted. c) Project runs as submitted - Make sure that the project compiles and runs correctly from the folder that you submit. Problems can occur when any of the project's files are not stored in the project's folder. If your project cannot locate a renuired file- your project will not run! - Test the project, make sure to test it on a computer other than the one on which you wrote it. 3. User Interface a) Professional appearance Layout, placement, spelling - Designing the user interface is a critical component in the project's construction. Anything that will appear on the screen for the user (forms, message boxes, etc.) must be presented in a professional format. The screen design should be easy to understand and "comfortable" for the user. - Use correct spelling and punctuation. - Name the form and change the Text property. The Text property appears in the form's title bar. - Set the StardPosition and Windorsitate properties to determine where how your form will appear. - Make sure that any text on the form displays completely, during both design time and run-time. b) Follows Windows standards - Follow industry standards in relation to color, size, and placement of controls. (Refer to Chapter 2, "Designing the User Interface".) Keyboard access keys ( \& in Text property, AcceptButton. CancelButton set) - Use keyboard access for all buttons and menus. For some assignments, you will also be required to include access keys for text boxes, radio buttons, and check boxes. - Follow industry standards whenever possible- use the X of Exit, and the S of Save. - Do not give two controls the same access key. - Set one button as the AccertButtong (it will respond when the user presses the Enter key) and set one button as the CancelButton (it will respond when the user presses the ESC key). Be aware that some users are accustomed to pressing the Enter key instead of using the Tab key to jump to the next field. Tab order is correct. - Make sure the focus is on the correct object when a form displays. The tab order must proceed correctly when the user presses the Tab key. 4. Standards and conventions a) Object names - Do not keep the default names assigned by Visual Basic, such as Buttonl and Label3. The exception to this rule is for labels that never change during project execution. These labels usually hold items such as titles, instructions, and labels for other controls. - Use good, consistent names for objects. - Use camel casing and end each name with the class of the object. - Object names with multiple words should have the first character of each word capitalized. Examples: - Do not name your objects with numbers. - Object names must begin with a letter or an underscore. The name can contain letters, digits, and underscores. An object name cannot include a space or punctuation mark and cannot be a reserved word. b) Identifiers for Variables and Named Constants - Follow the textbook's standards and conventions when naming (identifying) your variables and constants. - Variables: Identifiers must be meaningful. Do not abbreviate unless the meaning is obvious and do not use very short identifiers, such as X or Y. Include the class (data type) of the variable. Begin with a lowercase letter and then capitalize each successive word of the name. Example: FirotidameString CustomerAgeInteger - Constants: The name portion should be entirely in uppercase, with multiple words separated by underscores. - Identifiers for variables and named constants may consist of letters, digits, and underscores. They must begin with a letter, they cannot contain any spaces or periods or be reserved words. Reserved words are words to which Basic has asigned some meaning, such as print, name, and value. c) Option Strict On / All variables declared - In VB_NET, Option Explicit is turned on by default. The best practice is to turn on Option Strict either in code or in the Proient Designer. Make sure the Option Strict On statement appears above the Public Class statement. If Option Strict is tumed on, variables must be declared, regardless of the setting of Option Explicit - Declare local variables at the top of a procedure, below the remarks. - Declare module level variables and constants in the Declarations section. d) Remarks in the Declarations section - Include the following information at the top (Declarations section) of every form in your project: Project name Date Programmer Name Program Description e) Descriptive remarks in every procedure - Write remarks describing the purpose of the procedure at the top of every procedure. Use onmect spelling and punctuation in all remarks. f) Proper indentation - Follow the textbook coding conventions and indent all lines in sub procedures and sub functions. - Do not indent the lines in the Declarations section of a form. - Indent all lines inside If Then/Else, With/End With, For/Next, For/Each, Do/Loop, Select Case, Type/End Type, Try/Catch for readability. Examples: If tot:Name.Text ?" Then