Details of this Paper

This application will allow the user to enter the number of units

Description

solution


Question

Public Class Form1;Public Class Form1;Inherits System.Windows.Forms.Form; Software Sales.; This application will allow the user to enter the number of units; Sold for each package.; This application should calculate and display the total of the software; order in a message box.; Package A retail for: $99; Package B retail for: $199; Package C retail for: $299;Const decPackageA As Decimal = 99;Const decPackageB As Decimal = 199;Const decPackageC As Decimal = 299; 10 - 19 20% discount; 20 - 49 30% discount; 50 - 99 40% discount; 100 or more 50% discount;Const decDiscount10to19 As Decimal = 0.2D ' 10 to 19 quantities;Const decDiscount20to49 As Decimal = 0.3D ' 20 to 40 quantities;Const decDiscount50to99 As Decimal = 0.4D ' 50 to 99 quantities;Const decDiscount100orMore As Decimal = 0.5D ' 100 to more quantities; Package A retail for: $99; Package B retail for: $199; Package C retail for: $299;Const decPackageA As Integer = 99;Const decPackageB As Integer = 199;Const decPackageC As Integer = 299; 10 - 19 20% discount; 20 - 49 30% discount; 50 - 99 40% discount; 100 or more 50% discount; The following class-level constatns are used to calculate discounts.;Const decDiscount10to19 As Decimal = 0.2D ' 10 to 19 quantities;Const decDiscount20to49 As Decimal = 0.3D ' 20 to 40 quantities;Const decDiscount50to99 As Decimal = 0.4D ' 50 to 99 quantities;Const decDiscount100orMore As Decimal = 0.5D ' 100 to more quantities;Dim decPackageA As Integer ' First unit sold;Dim decPackageB As Integer ' Second unit sold;Dim decPackageC As Integer ' Third unit sold;Dim intGrandTotal As Integer ' Grand Total;Dim decDiscount As Decimal ' Discount;decPackageA = CInt(decPackageA - decDiscount);decPackageB = CInt(decPackageB - decDiscount);decPackageC = CInt(decPackageC - decDiscount);intGrandTotal = CInt(decPackageA + decPackageB + decPackageC * decDiscount); Check and make sure the number of units for each package is numeric; and is not negative.;Try;decPackageA = CInt(txtPackageA.Text);decPackageB = CInt(txtPackageB.Text);decPackageC = CInt(txtPackageC.Text);Catch ex As Exception;MessageBox.Show("Must be numeric, and not negative;Input Error");Return;End Try; Check the quantity range: must be 1 or >.;If (decPackageA.;If (decPackageB.;If (decPackageC = 100;decDiscount = decPackageA * decDiscount100orMore;End Select;Select Case decPackageB;Case 10 To 19;decDiscount = decPackageB * decDiscount10to19;Case 20 To 49;decDiscount = decPackageB * decDiscount20to49;Case 50 To 99;decDiscount = decPackageB * decDiscount50to99;C

 

Paper#69470 | Written in 18-Jul-2015

Price : $27
SiteLock