1.
Create a class named ElectricityBill to represent the electricity consumption details of
customers. Follow the instructions below to complete the task:
- Class Design Requirements:
Define a class ElectricityBill with the following members:
o A non-static field CustomerName of type string to store the name of the customer.
o A non-static field UnitsConsumed of type int to store the number of units
consumed.
o A static field UnitRate of type double and assign it a default value of 5.5 (indicating
cost per unit).
o Create three instances of the ElectricityBill class.
o draw the memory representation
2. Create a class EmployeeSalary to represent the salary details of employees.
- Class Design Requirements:
- Define a class EmployeeSalary with the following members:
o A non-static field Name of type string for employee name.
o A non-static field GrossSalary of type double for the total salary before tax.
o A static field TaxRate of type double, initialized to 10.0, representing the common
tax percentage.
o Create three employee instances with sample data.
o draw the memory representation
3. Create a class named WaterBill to represent the water consumption details of customers.
- Class Design Requirements:
- Define a class WaterBill with the following members:
o A non-static field CustomerName of type string to store the name of the
customer.
o A non-static field GallonsConsumed of type int to store the number of gallons
used.
o A static field RatePerGallon of type double initialized to 3.75 (cost per gallon).
o Create three instances of the WaterBill class with sample data.
o Draw the memory representation.
4. Create a class named StudentGrade to represent the grade details of students.
- Class Design Requirements:
- Define a class StudentGrade with the following members:
o A non-static field StudentName of type string to store the student's name.
o A non-static field Marks of type int to store the marks obtained.
o A static field PassMark of type int initialized to 40 (minimum passing marks).
o Create three instances of the StudentGrade class with sample data.
o Draw the memory representation.
5. Create a class named Book to represent details of books in a library.
- Class Design Requirements:
- Define a class Book with the following members:
o A non-static field Title of type string for the book title.
o A non-static field Author of type string for the author's name.
o A static field LibraryName of type string initialized to "City Central Library".
o Create three instances of the Book class with sample data.
o Draw the memory representation.
6. Create a class named CarRental to represent car rental details.
- Class Design Requirements:
- Define a class CarRental with the following members:
o A non-static field RenterName of type string to store the renter's name.
o A non-static field DaysRented of type int to store the number of days the car was
rented.
o A static field RatePerDay of type double initialized to 10000.0 (rental cost per day).
o Create three instances of the CarRental class with sample data.
o Draw the memory representation.
7. Create a class named MovieTicket to represent movie ticket booking details.
- Class Design Requirements:
- Define a class MovieTicket with the following members:
- A non-static field CustomerName of type string to store the customer's name.
- A non-static field NumberOfTickets of type int to store how many tickets were booked.
- A static field TicketPrice of type double initialized to 12.5 (price per ticket).
- Create three instances of the MovieTicket class with sample data.
- Draw the memory representation.
8. Create a class named GymMembership to represent gym membership details.
- Class Design Requirements:
- Define a class GymMembership with the following members:
o A non-static field MemberName of type string to store the member's name.
o A non-static field MembershipDurationMonths of type int to store the duration of
membership.
o A static field MonthlyFee of type double initialized to 25.0 (monthly membership
fee).
o Create three instances of the GymMembership class with sample data.
o Draw the memory representation.