Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design and code a project to calculate the amount due for rentals. Movies may be

ID: 440520 • Letter: D

Question

Design and code a project to calculate the amount due for rentals. Movies may be in VHS(videotape) format or DVD format. Videotapes rent for $1.80 each and DVDs rent for $2.50. New releases are 3$ for DVD and $2 for VHS.On the form include a text box to input the movie title and radio buttons to indicate weather the person is a member: member receive a 10 percent discount. Another check box indicates a new release. Use button for Calculate, clear for Next item, order,complete, summury ,print and exit. The Calculate button should display the item amount and add to the subtotal. The Clear for Next item button clear the check box for new releases, the movie title, and the radio button: the member check box cannot be changed until the current order in complete. Include validation to check for missing data. if the user clicks on the Calculate button without first entering the movie title and selecting the movie format, display message box. for the Order complete button, first confirm the operation with the user and clear the controls on the form for new customer. The Summary button display the number of customers and the sum of the rental amounts in a message box. Make sure to add to the customer count and rental sum for each customer order.

Explanation / Answer

Option Explicit 'WG 'CIS 210 'Chapter 5 'October 1, 2001 'This project calculates the amount due for rentals using a function procedure and checks validation for input using menus Private mcurAmount As Currency Private mcurSubtotal As Currency Private mcurTotalRentals As Currency Private mintTotalCustomers As Integer Private Sub mnuEditCalculate_Click() Call Calculate End Sub Private Sub mnuEditColor_Click() 'Displays the color dialog box dlgCommon.ShowColor 'Assigns dialog box color to the form frmVideo.BackColor = dlgCommon.Color End Sub Private Sub mnuEditFont_Click() 'Displays the font dialog box With dlgCommon .Flags = cdlCFScreenFonts .ShowFont End With End Sub Private Sub mnuEditNextItem_Click() 'Clears the input and output fields, option and checkboxes txtMovieTitle.Text = "" chkNewRelease = 0 chkMember = 0 optDVD.Value = False optVideotape.Value = False lblRentalAmount.Caption = "" lblDiscountAmount.Caption = "" lblSubtotalAmount.Caption = "" 'Sets focus txtMovieTitle.SetFocus End Sub Private Sub mnuEditOrderComplete_Click() 'Clear the form and prepare for the next customer If lblSubtotalAmount.Caption "" Then If mcurSubtotal 0 Then 'Clear the form mnuEditNextItem_Click lblSubtotalAmount.Caption = "" With chkMember 'Enable checkbox for next customer .Value = 0 .Enabled = True End With txtMovieTitle.SetFocus 'Add this customer to summary totals mcurTotalRentals = mcurTotalRentals + mcurSubtotal mintTotalCustomers = mintTotalCustomers + 1 mcurSubtotal = 0 'Reset total amount due for next customer End If Else Call MsgBox("Please calculate and complete the order", vbOKOnly, "Error") txtMovieTitle.SetFocus End If End Sub Private Sub mnuFileExit_Click() 'Terminates the program End End Sub Private Sub mnuFilePrintForm_Click() 'Prints the form frmVideo.PrintForm End Sub Private Sub mnuFileSummary_Click() 'Displays the totals lblCustomerCount.Caption = FormatNumber(mintTotalCustomers, 0) & Space(1) lblTotalRentalsAmount.Caption = FormatCurrency(mcurTotalRentals) & Space(1) 'Display the summary in a message box Dim strMessage As String If lblSubtotalAmount.Caption "" Then Call MsgBox("Incomplete Orders Are Not Included in Summary", _ vbOKOnly, "Form is not blank") ElseIf mintTotalCustomers > 0 Then Call MsgBox("Total Customers: " & mintTotalCustomers & vbCrLf & _ "Total Rentals: " & FormatCurrency(mcurTotalRentals), vbInformation + vbOKOnly, "Summary") Else Call MsgBox("No Data to Summarize", vbOKOnly, "Summary") End If txtMovieTitle.SetFocus End Sub Private Sub mnuHelpAbout_Click() 'Displays information about the programmer Call MsgBox("Programmed by WG, October 2001", vbInformation + vbOKOnly, "About the Application") End Sub Private Function Calculate() 'Calculates the amount due Dim curPrice As Currency Const curDiscount As Currency = 0.1 Dim curDiscountRate As Currency If txtMovieTitle.Text = "" Then Call MsgBox("Please enter movie title", vbExclamation + vbOKOnly, "Title Required") txtMovieTitle.SetFocus ElseIf optDVD.Value = False And optVideotape.Value = False Then Call MsgBox("Please select movie format", vbExclamation + vbOKOnly, "Format Required") Else chkMember.Enabled = True If chkNewRelease.Value = Checked And optDVD.Value = True Then curPrice = 3 ElseIf chkNewRelease.Value = Checked And optVideotape.Value = True Then curPrice = 2 ElseIf optVideotape.Value = True Then curPrice = 1.8 ElseIf optDVD.Value = True Then curPrice = 2.5 End If If chkMember.Value = Checked Then curDiscountRate = curDiscount * mcurAmount Else mcurAmount = curPrice End If End If 'Calculate and display customer's subtotal mcurSubtotal = mcurSubtotal + mcurAmount lblRentalAmount.Caption = FormatCurrency(mcurAmount) & Space(1) lblDiscountAmount.Caption = FormatNumber(curDiscountRate, 2) & Space(1) lblSubtotalAmount.Caption = FormatCurrency(mcurSubtotal) & Space(1) End Function
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote