Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

questiosn below 1. public class Product 2. private double price; 3. private String name; private static final double SALESTAX = 7.00; 5. public static int

questiosn below image text in transcribed
image text in transcribed
image text in transcribed
1. public class Product 2. private double price; 3. private String name; private static final double SALESTAX = 7.00; 5. public static int NumProducts = 0; 6. public Product(String name, double price) { 7. price = price; 8. name = name; 9. NumProducts++; 1 10. public String getName() { 11. return name; 1 12. public double getPrice() { 13. return price: 1 14. public void reduce Price (double price) 15. this.price - this.price price; ) 16. public void increase Price (double price) ( 17. Athis.price - this.price + price; > 18. public getPriceWithTax() { 19. return + ((SALESTAX/100)*this.price); 7. Assume in main method of a program, you create a Product Product p1 = new Product("iPhone5", 400.00); System.out.println(p1.getPriceWithTax()); When the program is run, it prints the value 428.00. A. What goes in the blank space in Line 18? (1 point) B. What goes in the black space in Line 19? (1 point) C. What would be the code in the main method to reduce the price of p1 by $50? (2 points) 8. What variable is called a constant variable in the Product class? (1 point)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

Are antidepressants an effective treatment?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago