Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the main method in the ProductDemo file to give discount ( by calling the reducePrice method ) only to customers who are 6 5
Modify the main method in the ProductDemo file to give discount by calling the reducePrice method only to customers who are or older.
Add the code to the ProductDemo file. DO NOT CHANGE the Product.java code.
If the customer is or older, give discount and show the discounted price. If not, show the regular price.
Note: Use the Scanner object to get the age.
Submit ProductDemo.java and output screenshot.
Write a description of class ProductDemo here.
@author your name
@version a version number or a date
public class ProductDemo
public static void mainString args
Product product new ProductExample Product", ;
System.out.printlnInitial Product Details:";
System.out.printlnName: product.getName;
System.out.printlnPrice: $ product.getPrice;
product. reducePrice;
System.out.println
Reduced Price:";
System.out.printlnPrice: $ product.getPrice;
Step 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