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

Write a program (VBA Program not CC) that calculates and displays in a MsgBox th

ID: 3801430 • Letter: W

Question

Write a program (VBA Program not CC) that calculates and displays in a MsgBox the bill for a cellular telephone company. The company offers two types of service. The rates are computed as follows:

Regular service: $10.00 plus first 50 minutes are free. Charges for over 50 minutes are $0.20 per minute.

Premium service: $25.00 plus:

For calls made from 6:00 am to 6:00 pm, the first 75 minutes are free;   charges for over 75 minutes are $0.10 per minute.

For calls made from 6:00 pm to 6:00 am, the first 100 minutes are free; charges for over 100 minutes are $0.05 per minute.

Your program should prompt the user to enter an account number (text) and a service code (allow r or R for regular service and p or P for premium service). Any other service code characters are errors and the user should correct or omit. In the MsgBox your program should display the account number, the type of service, the number of minutes the telephone service was used, and the amount due from the user.

For the premium service, the customer may be using the service during the day and the night. Therefore, to calculate the bill, you must ask the user to input the number of minutes the service was used during the day and the number of minutes the service was used during the night.   Do this only for premium customers.

Use a Do While to allow the user to continue entering data for additional customers or quit the program.

Explanation / Answer

Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim answer As Integer answer = MsgBox("Do want to see the total?", vbYesNo + vbQuestion, "Total") If answer = vbYes Then Range("G1").Value = Application.Sum(Range(Cells(3, 2), Cells(3, 3000))) Else 'do nothing End If End Sub

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