Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program 04 (Fall 2014) VB Auto Center Problem Purpose: You are to add Arguments and Parameters to Program 03. See slides 3, 4, and 5 for additional details.

Similar presentations


Presentation on theme: "Program 04 (Fall 2014) VB Auto Center Problem Purpose: You are to add Arguments and Parameters to Program 03. See slides 3, 4, and 5 for additional details."— Presentation transcript:

1 Program 04 (Fall 2014) VB Auto Center Problem Purpose: You are to add Arguments and Parameters to Program 03. See slides 3, 4, and 5 for additional details. All values are passed from one module to another thru Arguments and Parameters only; thus, you may not use module-level variables, but you may use module- level constants. 1.The total amount for Accessories and External Finish. Accessory Prices: - Stereo System = $400.00 - Leather Interior = $600.00 - Computer Navigation = $1,000.00 Exterior Finish Prices: - Standard Finish = No additional charge - Pearlized Finish = $500.00 - Customized Detailing = $300.00 2.Sales Tax -10% of (Selling Price + Accessories + External Finish) 3.Subtotal Subtotal = (Selling Price + Accessories + External Finish + Sales Tax) 4.Amount Due Amount Due = (Subtotal – Trade-in Allowance) Your Form must closely resemble this one: See the next slides for additional requirements. Due November 13, 2014 Points: 60 What you need to know to do this program: 1. Chapters 1,2,3,4,5,6 (Book and Notes) Radio buttons Check Boxes Don't forget this: Form1.Text. Place current date and time about here.

2 1.Do not allow bad input data to crash the program. Use try/catch blocks and IF-THEN-ELSE statements. Input errors must trigger an appropriate exception MessageBox. These exception messages must tell the data entry person what the error is and in which TextBox it occurred. For example, a message that simply tells the data entry person that “ Error made while entering data” is not sufficient. 2.Limit "Car's Sale Price" to $100,000. If $100,000 is exceeded, trigger an appropriate MessageBox and have the value re-entered. 3.Limit "Trade-in Allowance " to $50,000. If $50,000 is exceeded, trigger an appropriate MessageBox and have the value re-entered. 3.5 When an error occurs, change the backcolor of the appropriate textbox to yellow, UNTIL, the error is corrected. 4.Use good internal documentation. See class notes, and examples in this assignment. 5. Be sure to use the “.TOSTRING” method for all dollar amounts. Do not use FormatCurrency or FormatNumber. 6.Be sure to use correct data types for numeric calculations. 7.Use Option Strict On in your code. 8. You must use appropriate three-letter prefixes for variables, constants, and objects, such as Buttons, TextBoxes, etc. 9.Use good identifiers (constant names, variable names, object names, etc.). These should be as meaningful as possible, as short as possible, and as long as necessary. 10. Plan your project before writing code by writing out the steps necessary to solve the problem. 11. Be sure to use effective test data. This will insure that the program works correctly. 12.Set up click events that clear the appropriate input text box when clicked. This will allow easy re-entry of values if a typo is made. 13. Declare all constants at the module level of the code. 14.Declare all variables at the local level. 15. Use an appropriate Icon in your message boxes. See notes and book. 16.The Prices below must be CONSTANTS. ItemPrice Stereo System400.00 Leather Interior600.00 Computer Navigation1,000.00 StandardNo additional charge Pearlized500.00 Customized Detailing300.00 Tax Rate10% Programming Assignment 04 VB Auto Center Problem

3 Programming Assignment 04 VB Auto Center Problem OTHER REQUIREMENTS: 1.You MUST have these ten modules: You may have an eleventh module for a load event. 2. You MUST NOT use module-level variables. Module-level constants must be used. 3. Use arguments and parameters to pass data to and from modules. 4. NEVER USE ByRef except where necessary. Ask Dr. Scanlan for clarification on this if you don’t understand. 5. You may make-up your own variable names, procedure names, and argument/parameter names. FOLLOW THE RULES GIVE IN CLASS FOR IDENTIFIER NAMES. 6.NOTE: The red modules are all event procedures. 7. You must get the sales price and the trade-in allowance from the validate data module, ONLY.

4 Programming Assignment 04 VB Auto Center Problem MORE REQUIREMENTS: 8.You MUST use [#Region “text”/ #End Region] for all sections of code. 9. See EXIT code below to see where and how to place the Region blocks. 10.When a program is long, the Region blocks help organize your code. 11.ONLY, ONLY, ONLY use the two textboxes within the ValidateData module code. If you use one or both of these two textboxes in your code for “inputting” values other than the ValidateData module, you will get a zero (“0”) for this program. 12.You will also get a zero (“0”) for the program if you used a ByRef parameter when you could have use a ByVal parameter. 13.You must use Select Case instead of the If-Then-ElseIf in the Exterior Finishes Module. Failure to do this will result in a zero (“0”) for the program. This will give you practice with Select Case. 14.You will get a zero (“0”) for the program if you use module-level variables. 15.If the program fail to compile or is not on the CD, you will get a zero (“0”) for the program. Keep all files together. 16.Be sure to place current date and time on the form at the top.

5 Programming Assignment 04 VB Auto Center Problem Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim … Dim blnErrorFlag As Boolean = False Call ValidateData(blnErrorFlag, decSalesPrice, decTradeInAllowance) If blnErrorFlag = True Then Exit Sub End If Call End Sub Outline for BOSS MODULE (Main Procedure) If there is an error in the Validate Data module, this code will keep the four Call statements from being executed.

6 DOCUMENTATION EXAMPLE ONLY YOU MUST FOLLOW THE DOCUMENTATION CHARACTERISTICS OF THE PROGRAMS ON THE NEXT FOUR SLIDES. DOCUMENTATION EXAMPLE ONLY

7

8

9 Below is an example of how documentation must be done. Don't forget to add comments in the code where appropriate. Don't forget to document all button subroutines (sub-procedures). DOCUMENTATION EXAMPLE ONLY

10 (Print) Last _________________________________First_______________________ MIS 15 section: Noon Program: 1 2 3 4 5 6 7 8 9 10 11 12(Circle) GRADING STANDARDSPOINTS Form-A Program 4 VB Auto Center Problem Documentation was done according to guidelines; and used #Regions (0 OR 2 point) __________ GUI is reasonably correct:(0 OR 2 point) __________ Followed rules for forming constant names & variable names:(0 OR 2 point) __________ ALL calculated values are correct under ALL checkbox and radio button conditions:(0 OR 10 points) __________ Exit and All Clear buttons work correctly:(0 OR 4 points) __________ Validation module works correctly with appropriate error messages(0 OR 20 points) __________ (You may have one extra module for the Form Load event.) Arguments and Parameters are used correctly. NEVER use ByRef when you could have used ByVal.(0 or 20 points) __________ TOTAL POINTS:______________ Failure to follow hierarchy chart for program organization. (-20) Textboxes only inputted values outside the Validate Data module: (-60) Failure to use option strict on in the code: ( -40) Program fails to compile for any reason: (-60) Program uses one or more module-level variables (- 60) Failure to use Select Case statement in Exterior Finishes Module (- 60) Program not on CD or DVD-R: (- 60) Failure to follow submission guidelines: (-10) 50 percent off of each class day late Program is late if not handed in during the first 10 minutes on the due date. Note: Because of some ambiguity in the form’s GUI vs. the instructions, the tax can be calculated with or without subtracting the trade-in allowance. Both ways will be accepted. The preferred method would be to calculate the tax without the trade-in allowance, as indicated in the directions. Grader Comments:

11 Program #2 Fall 2011 11 Form-B STUDENT FILLS IN THESE BLANKS: LAST NAME:_______________________________ FIRST NAME:________________________ PROGRAM (Circle) 1 2 3 4 5 6 7 8 DATE DUE:_________________ DATE SUBMITTED:__________________ PLACE A CHECK NEXT TO THE FOLLOWING: 1.____Saved the Program on a CD or DVD-R using the following directory and sub-directory: Your Name\Program 04 2.____Printed your full name and program number on the CD or DVD-R using a permanent black marker. 3.____Submitted the CD or DVD-R in required envelope style not much larger than the CD or DVD-R. 4.____Placed the CD or DVD-R in the envelope. 5.____Cut out this form along dotted edges and TAPE it to the envelope. Use CD or DVD-R to submit program. CUT OUT THIS FORM ALONG THE DOTTED EDGES AND TAPE IT TO THE ENVELOPE. YOU MUST USE THIS STYLE THAT IS ABOUT THE SIZE OF YOUR CD. Do not lick to seal. Use metal clip. Program 4 VB Auto Center Problem


Download ppt "Program 04 (Fall 2014) VB Auto Center Problem Purpose: You are to add Arguments and Parameters to Program 03. See slides 3, 4, and 5 for additional details."

Similar presentations


Ads by Google