Answered step by step
Verified Expert Solution
Link Copied!

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: {Bill_Number, Consumer_Details, Month, Year, Units_Consumed, Bill_Amount}. The Consumer_Details include: {Consumer_ID, Name, Age, Address, Gender}. Please answer the following questions:
Create structure definitions required for storing a record of electricity bill (struct electricity_bill) 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. 12M
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 Bill_Amount for each record from the user. However, it must be calculated using Units_Consumed as per the slab rates given below:
0-100 units: Rs 5 per unit
101-200 units: Rs 10 per unit
200 and above: Rs 15 per unit
For example, if Units_Consumed =250, then Bill_Amount =100**5+100**10+250**16=$250.
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. 16M
Now, you want to subsidize the electricity bill for senior citizens (age >65). Write a function subsidizeBills() which takes the above doubly linked list of billing records as input and recalculates the Bill_Amount for each record after applying the subsidy of 50% for senior citizens, wherever applicable. 8M
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

What does this key public know about this issue?

Answered: 1 week ago

Question

What is the nature and type of each key public?

Answered: 1 week ago

Question

What does this public need on this issue?

Answered: 1 week ago