Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bock Repair Parts Sales operates a used automotive sales lot. Management requires an application that will compute automotive sales information for the sale of a

 Bock Repair Parts Sales operates a used automotive sales lot. Management requires an application that will compute automotive sales information for the sale of a used vehicle. You are to develop an application to compute the total due from a customer purchasing a used vehicle – the customer may have a trade-in vehicle. Sometimes the company sells used vehicles to other used automotive lots and offers them a discount on the price of the vehicle. This is termed a wholesale dealer discount. Requirements. Develop a form that is similar to the one shown below. You may have minor differences. Application Use and Special Instructions The application user will enter the lot number that identifies a vehicle, the year, and the vehicle make and model as shown in the figure above. • Price and Trade-in: The price for a vehicle is negotiated and entered into the price TextBox control. If the purchaser has a trade-in vehicle, the value of the trade-in is negotiated and this value is entered into the trade-in TextBox control. If the purchaser does not have a trade-in, then the value “0.00” should display in the trade-in TextBox control. Discounts: If the buyer is another car dealership, then the application user will check the wholesale discount checkbox and this will give the purchasing wholesale dealer a 20% discount on the vehicle price only. Extras: Sometimes customers wish to have a used vehicle touched-up or have extras added prior to taking possession of the vehicle. Extras are not included in the price and the customer pays extra according to the table given below. For Exterior Extras, the None RadioButton control should be checked as the default when the form starts up. Exterior Extras Accessory Extras Item Cost Item Cost No exterior extras $0.00 New Tires $450.00 Paint Touch-Up $250.00 New HD Radio $190.95 Undercoat $300.00 Built-in GPS $700.00 Both $550.00 New Floor Mats $55.00 Subtotal: This is computed as the price less the amount of discount (if any) plus the cost of extras (if any). • Sales Tax: Regular customers must pay a state sales tax on their purchase. The tax rate is 5% and is computed on the subtotal. Wholesale dealers purchasing a vehicle do NOT pay any sales tax. • Total due: This is computed as the subtotal plus the sales tax less the value of the trade-in (if any). • Constants: You must declare constants to store the wholesale discount rate, sales tax rate, and cost of exterior and accessory extras, as appropriate. Build and Code the Project Design. Use GroupBox, Label, TextBox, RadioButton, CheckBox, and Button controls as shown in the figure. Input TextBox controls include the lot number, year, vehicle make/model, price, and trade-in. Left and right-align data as shown in the figure. The output TextBox controls are all set to read-only with the TabStop = False. The tab order must be top to bottom, left to right within the GroupBox controls. Note, when tabbing to a GroupBox that contains RadioButton or CheckBox controls the application user must use the up/down arrow keys on the keyboard to select between these controls. All Buttons are enabled on startup and remain enabled throughout use of the application. Assign hot keys to all Button controls. Also assign hot keys set to Label controls that are associated with input TextBox controls and CheckBox controls. You decide which letters on the controls to use as hot keys. Map the Compute Button control to the keyboard Enter key; map the Reset Button control to the keyboard Esc key. On startup, the trade-in TextBox control should display a value of 0.00 – this will enable the application user to tab past this control whenever there is no trade-in vehicle. Programming Events. Add remarks to the program as required. You must set OPTION STRICT ON. Validating Data. You must write code to enforce the business rules listed below whenever the Compute Button control is clicked. Rule #1 – the lot number TextBox cannot be blank. Rule #2 – the year TextBox cannot be blank. Rule #3 – the vehicle make/model TextBox cannot be blank. Rule #4 – the price TextBox must contain a numeric value that is greater than zero (no vehicles are given away). Rule #5 – the trade-in TextBox must contain a numeric value that is greater than or equal to zero (allowing a zero value allows for customers that have no trade-in). Compute Button Coding. Data is entered into the input TextBox controls. This includes entering the lot number, year, vehicle make/model, checking the wholesale dealer discount CheckBox control if appropriate, entering the price, and entering a trade-in value if appropriate. Next application users select among the exterior and accessory extras. Only one exterior extra can be selected, but users can select zero, one, or more accessory extras. When the Compute Button is clicked, your code must: Declare variables and constants as required. Use a Try-Catch block to catch any exceptions that may occur including those associated with data entry as general exceptions. Use an If-ElseIf-Else-End If structure to enforce all business rules. Compute the wholesale discount using the discount rate when the wholesale discount Checkbox is checked; otherwise, the discount is zero. The discount applies to the price only – extras are charged at the full rate. Compute the cost of extras (hint: use a local accumulation variable to accumulate both exterior and accessory extra charges). Compute the subtotal, sales tax, and total due. Use the Round method as appropriate for calculations. Use the Parse and Convert methods as appropriate within the program. Accumulate the grand total due (that is the total of all total due values) to a decimal variable. Accumulate a count of the number of vehicles sold to an integer variable – you can assume that when the Compute button is clicked, a vehicle has been sold. Reset Form Button Coding. Clear all data input and output TextBox controls (except the TradeInTextBox – set this control’s Text = “0.00”). Uncheck all CheckBox controls. Reset the exterior extra RadioButton control to the None option. Set focus to the lot number TextBox control. Totals Button Coding. Display a message box like the one shown below that gives the total due for all sales, number of vehicles sold, and average total due per vehicle sold. Use a Try-Catch block with multiple Catch blocks to catch the exception that can occur if there have not been any vehicles sold yet, and to catch any general exceptions that may occur. The message box for a no vehicles sold yet exception is shown below. You can design an appropriate message box for a general exception. Exit Button Coding. When the Button is clicked, do not automatically close the form. Instead, write code to only close the form if the application user responds Yes to the question shown in this figure. The code should default the selection to the No button.


Step by Step Solution

3.36 Rating (140 Votes )

There are 3 Steps involved in it

Step: 1

Lab 3 Bock Repair Parts Sales operates a used automotive sales lot Management requires an applicatio... blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Mathematics for Business Economics Life Sciences and Social Sciences

Authors: Raymond A. Barnett, Michael R. Ziegler, Karl E. Byleen

12th edition

321614003, 978-0321614001

Students also viewed these Accounting questions

Question

Describe a procedure for solving a first-degree inequality.

Answered: 1 week ago

Question

6.10 a. Find a z o such that P(-z

Answered: 1 week ago