Computer Science, asked by prachigzp2402, 5 months ago

3. Define a class Electric Bill with the following specifications:
class: ElectricBill
Instance Variable/ data member:
String n - to store the name of the customer
int units - to store the number of units consumed
double bill - to store the amount to paid
Member methods:
Void accept() - to accept the name of the customer and number of units consumed
Void calculate - to calculate the bill as per the following tariff:
Number of units
Rate per unit
First 100 units
Rs.2.00
Next 200 units
Rs.3.00
Above 300 units
Rs.5.00
A surcharge of 2.5% charged if the number of units consumed is above 300 units.
Void print - To print the details as follows:
Name of the customer Number of units consumed Bill amount​

Answers

Answered by subhasia401
0

Answer:

What to do plzzzzzzzz tell

Similar questions