Write a COBOL program to calculate the amount of a mobile phone bill. A call is
ID: 667010 • Letter: W
Question
Write a COBOL program to calculate the amount of a mobile phone bill. A call is charged 30 cents per minute. The cost for line rental is RM60.00. The tax for the overall bill (including the line rental) is 15%. Calculate the amount that has to be paid by the user given the number of minutes that the user uses his/her mobile phone.
Sample output:
Enter the number of minutes user have been using the phone :
10
Bill amount including line rental is RM 63.00
Total bill to be paid including tax is RM 72.45
Sample output:
Enter the number of minutes user have been using the phone :
10
Bill amount including line rental is RM 63.00
Total bill to be paid including tax is RM 72.45
Explanation / Answer
IDENTIFICATION DIVISION.
PROGRAM-ID. MOBILE BILL.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MIN PIC X(15).
01 TOTAL PIC 999.99
01TTAX PIC 999.99
PROCEDURE DIVISION.
ACCEPT-PARA.
DISPLAY "Enter the number of minutes user have been using the phone ".
ACCEPT MIN.
COMPUTE-PARA.
COMPUTE TOTAL=60+(MIN*.3)
COMPUTE TTAX=TOTAL+(TOTAL*.15)
DISPLAY-PARA
DISPLAY "BILL AMOUNT INCLUDING RENTAL IS RM=",TOTAL.
DISPLAY "TOTAL BILL TO BE PAID WITH TAX IS RM=",TTAX.
STOP RUN.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.