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 amount due for rentals. Movies may be in

ID: 673133 • Letter: D

Question

Design and code a project to calculate amount due for rentals. Movies may be in VHS format or dvd format. Videotapes rent for $1.80 a each and DVDS rent for 2.50. New releases are $3 for DVD and 2.00 VHS.

On the form include a text box to input the movie title and radio buttons to indicate wheather the movie is DVD or VHS Format. Use one check box to indicate wheather a person ia a memeber : members recieve a 10% discount.Another check box indicates a new release.

Use buttons for calculate, clear for next item, order complete, summary,print and exit. The calculate button should display the item amount and display the subtotal. The Clear for next button clears the check box for new releases, the movie title and the radio buttons; the member check box cannot be changed until the current order is 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 a message box.

For the order complete button, first confirm the operation with the user and clear the controls on the form for a new customer.

The summary button displays the number of customers and the sum of the rental accounts in a mesage box. make sure to add to the customer count and rental sum for each customer order.

Please provide the GUI and the coding for the above problem, there is no appropriate answer on CHEGG Thank You!!

Explanation / Answer

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