Question: SAMPLE OUTPUT: A telco company needs a program that able to identify if the customer is eligible to get a rebate in the next bill

SAMPLE OUTPUT: A telco company needs a program that able to identify if the customer is eligible to get a rebate in the next bill cycle. Write a complete C program based on the below requirements: PAY DAY 3 25 20 BILL NO 3291 9992 32917645 32914321 32917645 PLAN 300-pa 500-Mbps 500-pe 100 Mbps PAYNENE 369.94 RM263.94 RX263.94 RM200.34 02/2021 UNIFI BILL PAYMENT 100 CUST NAME ACCS NO 1 Janet 1023928182 2 Remy 1023929817 3 Belle 1023928891 4 Hair 1023929817 Add record Nane Hans Acct No. 1029384756 Day of Payment 18 11 No. 32982238 Plan 100-Mbps Add record again? a) Create a structure called Account, and below are the structure members: o Customer Name name (string) o Subscribed Plan plan (string) Day of payment day (integer) O Account No acetNo (integer) o Bill No. billNo (integer) o Payment amount payment (float) Then, at the structure, create a structure variable called user. b) In the main function, declare 2 pointer variables called fread and fwrite of file type, Use fread pointer to read and append a file called unif billFeb.txt, o Use fwrite pointer to write to a file called rebate acct.txt o Below is the content of unifi billFeb oxr before program execution, unifi_billFeb.txt (Before Execution) Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Belle 1023928891 25 0032914321 500-Mbps 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 Name nect No. Day of Payment 21 No. plan I Danny 1029389039 119 32918279 800-pa Add record again? ........YCLE e) Then, read each record of the updated unifi billFeb.exr from the beginning, then identify if the customer is eligible for a rebate based on the following condition, o If the day of payment for February bill is before 15 of the month, then the customer is entitled with a rebate in the next bill cycle. o Then, display the customer name, customer account no, and subseribed plan to the output screen o Record the data into rehate_acct.txt. unifi_billFeb.txt (After Execution) CacctNo> Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Belle 1023928891 25 0032914321 500-Mbps 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 Hana 1029384756 8 32982738 100-Mbps 200.34 Danny 1029389039 19 32918279 800-Mbps 369.94 rebate acct.txt (After Execution) CacetNoXplan> Janet 1023928182 800-Mbps Remy 1023929817 500-Mbps Hana 1029384756 100-Mops ACCT TO GET REBATE ON NEXT BILL CYCLE ........................ NO. CUST NAME ACCT NO 1 Janet 1023928182 2 1023929817 3 Hana 1029384756 PLAN B00Mbps 500- 100-Mops New Record c) Read each record in unifi billFeb.txt, store it into the structure and display it to the output screen (Refer to the sample output) o If the file does not exist, display an error message and terminate the program. d) Ask the user if they wish to add record to the file. As long as user enter 'Y", then get the following information from the user: o Get the customer's name, account no, day of payment, bill no and subscribed plan and store it into the structure Based on the subscribed plan, identify the price of the plan. Refer to the table below Subscription Plan Price 100 Mbps 200.34 500-Mbps 26394 800-Mbps 369.94 o Update the file with the new record. f) Close all files after program execution has completed. g) Refer to the sample output. | SAMPLE OUTPUT: A telco company needs a program that able to identify if the customer is eligible to get a rebate in the next bill cycle. Write a complete C program based on the below requirements: PAY DAY 3 25 20 BILL NO 3291 9992 32917645 32914321 32917645 PLAN 300-pa 500-Mbps 500-pe 100 Mbps PAYNENE 369.94 RM263.94 RX263.94 RM200.34 02/2021 UNIFI BILL PAYMENT 100 CUST NAME ACCS NO 1 Janet 1023928182 2 Remy 1023929817 3 Belle 1023928891 4 Hair 1023929817 Add record Nane Hans Acct No. 1029384756 Day of Payment 18 11 No. 32982238 Plan 100-Mbps Add record again? a) Create a structure called Account, and below are the structure members: o Customer Name name (string) o Subscribed Plan plan (string) Day of payment day (integer) O Account No acetNo (integer) o Bill No. billNo (integer) o Payment amount payment (float) Then, at the structure, create a structure variable called user. b) In the main function, declare 2 pointer variables called fread and fwrite of file type, Use fread pointer to read and append a file called unif billFeb.txt, o Use fwrite pointer to write to a file called rebate acct.txt o Below is the content of unifi billFeb oxr before program execution, unifi_billFeb.txt (Before Execution) Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Belle 1023928891 25 0032914321 500-Mbps 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 Name nect No. Day of Payment 21 No. plan I Danny 1029389039 119 32918279 800-pa Add record again? ........YCLE e) Then, read each record of the updated unifi billFeb.exr from the beginning, then identify if the customer is eligible for a rebate based on the following condition, o If the day of payment for February bill is before 15 of the month, then the customer is entitled with a rebate in the next bill cycle. o Then, display the customer name, customer account no, and subseribed plan to the output screen o Record the data into rehate_acct.txt. unifi_billFeb.txt (After Execution) CacctNo> Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Belle 1023928891 25 0032914321 500-Mbps 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 Hana 1029384756 8 32982738 100-Mbps 200.34 Danny 1029389039 19 32918279 800-Mbps 369.94 rebate acct.txt (After Execution) CacetNoXplan> Janet 1023928182 800-Mbps Remy 1023929817 500-Mbps Hana 1029384756 100-Mops ACCT TO GET REBATE ON NEXT BILL CYCLE ........................ NO. CUST NAME ACCT NO 1 Janet 1023928182 2 1023929817 3 Hana 1029384756 PLAN B00Mbps 500- 100-Mops New Record c) Read each record in unifi billFeb.txt, store it into the structure and display it to the output screen (Refer to the sample output) o If the file does not exist, display an error message and terminate the program. d) Ask the user if they wish to add record to the file. As long as user enter 'Y", then get the following information from the user: o Get the customer's name, account no, day of payment, bill no and subscribed plan and store it into the structure Based on the subscribed plan, identify the price of the plan. Refer to the table below Subscription Plan Price 100 Mbps 200.34 500-Mbps 26394 800-Mbps 369.94 o Update the file with the new record. f) Close all files after program execution has completed. g) Refer to the sample output. |