Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are the Billing Manager at ABC Electricity Distribution Board Ltd . You job is to maintain monthly electricity bills of various consumers of your
You are the Billing Manager at ABC Electricity Distribution Board Ltd You job is to maintain monthly electricity bills of various consumers of your company and give them subsidies as applicable. You need to maintain a doubly linked list that stores the records of electricity bills having the following attributes: BillNumber, ConsumerDetails, Month, Year, UnitsConsumed, BillAmount The ConsumerDetails include: ConsumerID Name, Age, Address, Gender Please answer the following questions:
Create structure definitions required for storing a record of electricity bill struct electricitybill and a record of consumer details struct consumer Choose most appropriate datatypes so as to minimize the number of bytes required to store each attribute. Marks will be deducted if datatypes are not the most appropriate ones Also create structure definitions for the header and the node separately as required for creating a doubly linked that can store records of electricity bills.
Write a function readDetails that takes the input: number of billing records from the user and reads details of that many number of billing records from the user and stores them in a doubly linked list. You should NOT read BillAmount for each record from the user. However, it must be calculated using UnitsConsumed as per the slab rates given below:
units: Rs per unit
units: Rs per unit
and above: Rs per unit
For example, if UnitsConsumed then BillAmount $
The function must return the doubly linked created above. DON'T CREATE ANY ADDITIONAL FUNCTIONS. No marks will be awarded if you create additional functions. Also, the design of your doubly linked list must adhere to the specifications give above. Any deviation will incur a penalty or awarded zero.
Now, you want to subsidize the electricity bill for senior citizens age Write a function subsidizeBills which takes the above doubly linked list of billing records as input and recalculates the BillAmount for each record after applying the subsidy of for senior citizens, wherever applicable.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started