Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Q6.2 Based on the Lecture 1 - exercise, please export one library (.jar) which contains Class PetrolPurchase and Class Car and import to the
Java
Q6.2 Based on the Lecture 1 - exercise, please export one library (.jar) which contains Class PetrolPurchase and Class Car and import to the solution in this new project - Reporting. In Reporting, create an object of Car and another object of Petrolpurchase. Define two methods which are both called as show and to use method overloading technique to display the information of the Car and the Pertolpurchase. Suggested JAVA program structure: public class Reporting { public static void main(String[] args) { Car c3 = new Car("Vw", 2015, 40000); //Applying the discount c3.setPrice(c3.getPrice() * 0.95); // create PetrolPurchase by constructor PetrolPurchase purchase3 = new PetrolPurchase("Taiwai", "Super", 10, 14.8, 10); //Show Information of car and purchase show(...); show(...); } public static void show...) { public static void show...) { } run: : The price of the Vw model 2015 after the discount is $3000.00 the net purchase amount = 133.20 @ Taiwai BUILD SUCCESSFUL (total time: 0 seconds) You should be able to show the result as aboveStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started