OBJECT ORIENTED PROGRAMMING LABORATORY

1. EB Bill Calculator

Develop a Java application to generate Electricity bill. Create a class with the following members:

  • Consumer no.,
  • consumer name,
  • previous month reading,
  • current month reading,
  • type of EB connection(i.e domestic or commercial).

Compute the bill amount using the following tariff. If the type of the EB connection is domestic, calculate the amount to be paid as follows:

  • First 100 units – Rs. 1 per unit
  • 101-200 units – Rs. 2.50 per unit
  • 201 -500 units – Rs. 4 per unit
  • 501 units – Rs. 6 per unit

If the type of the EB connection is commercial, calculate the amount to be paid as follows:

  • First 100 units – Rs. 2 per unit
  • 101-200 units – Rs. 4.50 per unit
  • 201 -500 units – Rs. 6 per unit
  • > 501 units – Rs. 7 per unit

2. Converters

Develop a java application to implement

  • Currency Converter (Dollar to INR, EURO to INR, Yen to INR and vice versa)
  • Distance Converter (meter to KM, miles to KM and vice versa)
  • Time Converter (hours to minutes, seconds and vice versa)

using packages.