In this activity, you will write your own a Java program that makes use of inheritance to develop derived classes from a base class.

PROG6112_LU2_Class_A_B_C
Instructions:
Using any application of your choice, write a Java program for a business that collects and sells antiques. In your program:
Create a class named ItemSold with three fields for an invoice number, a description and a price Get and set methods for each field;
Create a subclass named LampSold that descends from ItemSold and includes Boolean fields that indicate the condition and age of an antique item. Include the necessary get and set methods;
Write an application that creates 2 objects of each class and demonstrate that all the methods work correctly.
Save your program, compile and run it until it is working correctly.
Save a screenshot of the output using your student number in the file name.
Return to this screen and click the link above the red arrow to open the Blog tool.
Create a new entry and:
Type Inheritance in the Title field;
Attach your screenshot;
Briefly describe what aspect(s) of this activity you found difficult.

To complete this activity, you will need to follow these steps:

1. Open your preferred Java IDE or text editor.

2. Create a new Java file named "ItemSold.java" and define a class called "ItemSold". This class should have three private fields: invoiceNumber (int), description (String), and price (double). You also need to provide public getter and setter methods for each field.

3. In the same file, create a subclass named "LampSold" that extends "ItemSold". This subclass should have two additional private boolean fields: condition and age. You also need to provide public getter and setter methods for these fields.

4. Create another Java file named "Main.java" to write your application. In this file, you will create objects of both the "ItemSold" class and the "LampSold" class.

5. Instantiate two objects of the "ItemSold" class, and set their invoiceNumber, description, and price using the setter methods.

6. Instantiate two objects of the "LampSold" class, and set their invoiceNumber, description, price, condition, and age using the setter methods.

7. To demonstrate that all the methods work correctly, you can use System.out.println statements to display the values of the fields for each object. For example:

```
ItemSold item1 = new ItemSold();
item1.setInvoiceNumber(123);
item1.setDescription("Antique vase");
item1.setPrice(100.0);

System.out.println("Invoice Number: " + item1.getInvoiceNumber());
System.out.println("Description: " + item1.getDescription());
System.out.println("Price: $" + item1.getPrice());

LampSold lamp1 = new LampSold();
lamp1.setInvoiceNumber(456);
lamp1.setDescription("Antique lamp");
lamp1.setPrice(200.0);
lamp1.setCondition(true);
lamp1.setAge(50);

System.out.println("Invoice Number: " + lamp1.getInvoiceNumber());
System.out.println("Description: " + lamp1.getDescription());
System.out.println("Price: $" + lamp1.getPrice());
System.out.println("Condition: " + lamp1.getCondition());
System.out.println("Age: " + lamp1.getAge());
```

8. Save your Java files, compile them, and run the program to see the output. You can use the command line or the IDE's running capabilities.

9. Take a screenshot of the output, and save it with a filename that includes your student number.

10. Go back to the provided website or blogging platform, create a new entry, and give it a title, such as "Inheritance."

11. Attach your screenshot to the blog entry.

12. Briefly describe any aspects of this activity that you found difficult in the blog entry. This could include challenges with understanding inheritance or implementing the getter and setter methods.

13. Submit your blog entry.

By following these steps, you will create a Java program that demonstrates inheritance by developing derived classes from a base class.