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: 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 subscribed plan to a) Create a structure called Account, and below are the structure members: the output screen. o Customer Name o Subscribed Plan o Day of payment o Account No. o Bill No. o Payment amount payment (float) name (string) : plan (string) : day (nteger) acctNo (integer) billNo (integer) o Record the data into rebate_acct.txt. unifi_billFeb.txt (After Execution) Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Belle 1023928891 25 0032914321 500-Mops 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 Then, at the structure, create a structure variable called user. Hana 1029384756 8 32982738 100-Mbps 200.34 b) In the main function, declare 2 pointer variables called fread and fwrite of file type. o Use fread pointer to read and append a file called unifi_billFeb.Ext. o Use furite pointer to write to a file called rebate_acct.txt. New Record Danny 1029389039 19 32918279 800-Mops 369.94 rebate_acct.txt (After Execution) Janet 1023928182 800-Mbps Remy 1023929817 500-Mbps o Below is the content of unifi_billFeb.txt 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-Mops 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 Hana 1029384756 100-Mbps f) Close all files after program execution has completed. g) Refer to the sample output. c) Read each record in umifi 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. SAMPLE OUTPUT: 02/2021 UIFI BILL PAENT CUST NAME ACCT NO PAT CAT BILL NO PLAN PATMENT 10239212 1023927 32919992 3291745 32914321 32917645 Janet d) Ask the user if they wish to add record to the file. As long as user enter 'Y", then get Beny Belle 500-1 500-pe 100-pe 19.94 C43.54 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. C3.4 Hairi 102392417 C00.34 Ads recordtY Nane I Rana 4756 o Based on the subscribed plan, identify the price of the plan. Refer to the table below: Acet No. Dey of Payment 3292738 100-os Plan Subscription Plan 100-Мbps 500-Mbps 800-Mbps Price 200.34 263.94 Add recerd again? Y Nane Acet so. Day of ayent Bil No. Plan I banay 1029eso39 369.94 329 800-Mpa o Update the file with the new record. Ads recoed again? ... ... ........ ACCT TO GET EBATE ON EXT BILL CYCLE ....

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
4754
QUESTION 3
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:
e) Then, read each record of the updated unifi_billFeb.txt 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 subscribed plan to
the output screen.
o Record the data into rebate_acct.txt.
a) Create a structure called Account, and below are the structure members:
:name (string)
: plan (string)
: day (integer)
: acctNo (înteger)
: billNo (integer)
: payment (float)
o Customer Name
o Subscribed Plan
o Day of payment
o Account No
o Bill No.
o Payment amount
unifi_billFeb.txt (After Execution)
<name><acctNo><day><bil1No><plan><<payment>
Janet 1023928182 12 0032919992 800-Mbps 369.94
Remy 1023929817 3 0032917645 500-Mbps 263.94
Belle 1023928891 25 0032914321 500-Mbps 263.94
Then, at the structure, create a structure variable called user.
Hairi 1023929817 20 0032917645 100-Mbps 200.34
Hana 1029384756 8 32982738 100-Mbps 200.34
b) In the main function, declare 2 pointer variables called fread and fwrite of file type.
o Use fread pointer to read and append a file called unifi_billFeb.txt.
o Use fwrite pointer to write to a file called rebate_acct.txt.
o Below is the content of unifi_billFeb.txt before program execution.
New Record
Danny 1029389039 19 32918279 800-Mbps 369.94
rebate_acct.txt (After Execution)
<name><acctNo><plan>
Janet 1023928182 800-Mbps
unifi_billFeb.txt (Before Execution)
<name><acctNo><day><bil1No><plan><payment>
| Janet 1023928182 12 0032919992 800-Mbps 369.94
Remy 1023929817 3 0032917645 500-Mbps 263.94
Remy 1023929817 500-Mbps
Hana 1029384756 100-Mbps
f) Close all files after program execution has completed.
g) Refer to the sample output.
Belle 1023928891 25 0032914321 500-Mbps 263.94
Hairi 1023929817 20 0032917645 100-Mbps 200.34
c) Read each record in umifi_billFeb.txt, store it into the structure and display it to the
output screen. (Refer to the sample output)
SAMPLE OUTPUT
www............*
.....
02/2021 UNIFI BILL BAYMENT
o If the file does not exist, display an error message and terminate the program.
...............
NO.
NO.
PAYMENT
349.94
CUST NAME
ACCT NO
1023920182
102392917
102392091
1023929017
FAY DAY
BILL NO
32919992
32917645
PLAN
800-pa
500-ps
500-ps
100-Mpe
Janet
12
d) Ask the user if they wish to add record to the file. As long as user enter 'Y', then get
Reny
Belle
25
20
32914321
32917645
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.
o Based on the subscribed plan, identify the price of the plan. Refer to the table
below:
Hairi
F200.34
Add record?Y
Name
Acct No.
Day of Paynent
ill so.
Plan
I Hana
1 102934756
1329273
: 100-eps
Subscription Plan
100-Mbps
500-Mbps
800-Mbps
Price
200.34
263.94
Add record again? Y
Name
Acct No.
Day of Payment
Bill No.
Plan
I Danny
1029eso39
19
: 32910279
: 800-eps
369.94
o Update the file with the new record.
Ads record again? N
.....................................
ACCT TO GET REBATE O NEXT BILL CYCLE
.....
...............
CUST NAME
Janet
NO.
ACCT NO
1023920102
102392917
102934754
PLAN
800-ps
500-ps
100-Mps
Reny
Hana
Transcribed Image Text:4754 QUESTION 3 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: e) Then, read each record of the updated unifi_billFeb.txt 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 subscribed plan to the output screen. o Record the data into rebate_acct.txt. a) Create a structure called Account, and below are the structure members: :name (string) : plan (string) : day (integer) : acctNo (înteger) : billNo (integer) : payment (float) o Customer Name o Subscribed Plan o Day of payment o Account No o Bill No. o Payment amount unifi_billFeb.txt (After Execution) <name><acctNo><day><bil1No><plan><<payment> Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Belle 1023928891 25 0032914321 500-Mbps 263.94 Then, at the structure, create a structure variable called user. Hairi 1023929817 20 0032917645 100-Mbps 200.34 Hana 1029384756 8 32982738 100-Mbps 200.34 b) In the main function, declare 2 pointer variables called fread and fwrite of file type. o Use fread pointer to read and append a file called unifi_billFeb.txt. o Use fwrite pointer to write to a file called rebate_acct.txt. o Below is the content of unifi_billFeb.txt before program execution. New Record Danny 1029389039 19 32918279 800-Mbps 369.94 rebate_acct.txt (After Execution) <name><acctNo><plan> Janet 1023928182 800-Mbps unifi_billFeb.txt (Before Execution) <name><acctNo><day><bil1No><plan><payment> | Janet 1023928182 12 0032919992 800-Mbps 369.94 Remy 1023929817 3 0032917645 500-Mbps 263.94 Remy 1023929817 500-Mbps Hana 1029384756 100-Mbps f) Close all files after program execution has completed. g) Refer to the sample output. Belle 1023928891 25 0032914321 500-Mbps 263.94 Hairi 1023929817 20 0032917645 100-Mbps 200.34 c) Read each record in umifi_billFeb.txt, store it into the structure and display it to the output screen. (Refer to the sample output) SAMPLE OUTPUT www............* ..... 02/2021 UNIFI BILL BAYMENT o If the file does not exist, display an error message and terminate the program. ............... NO. NO. PAYMENT 349.94 CUST NAME ACCT NO 1023920182 102392917 102392091 1023929017 FAY DAY BILL NO 32919992 32917645 PLAN 800-pa 500-ps 500-ps 100-Mpe Janet 12 d) Ask the user if they wish to add record to the file. As long as user enter 'Y', then get Reny Belle 25 20 32914321 32917645 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. o Based on the subscribed plan, identify the price of the plan. Refer to the table below: Hairi F200.34 Add record?Y Name Acct No. Day of Paynent ill so. Plan I Hana 1 102934756 1329273 : 100-eps Subscription Plan 100-Mbps 500-Mbps 800-Mbps Price 200.34 263.94 Add record again? Y Name Acct No. Day of Payment Bill No. Plan I Danny 1029eso39 19 : 32910279 : 800-eps 369.94 o Update the file with the new record. Ads record again? N ..................................... ACCT TO GET REBATE O NEXT BILL CYCLE ..... ............... CUST NAME Janet NO. ACCT NO 1023920102 102392917 102934754 PLAN 800-ps 500-ps 100-Mps Reny Hana
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education