Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with this program: Create an application that contains a method that

ID: 3641164 • Letter: I

Question

I need help with this program:

Create an application that contains a method that computes the final price for a sales transaction and returns that value to a calling method. The method requires three arguments:
? product price,
? salesperson commission rate, and
? customer discount rate.
A product’s final price is the original price plus the commission amount minus the discount amount; the customer discount is taken as a percentage of the total price after the salesperson commission has been added to the original price. Write a main() method that prompts the user for the price of an item, the salesperson’s commission expressed as a percentage, and the customer discount expressed as a percentage, and that then passes the values to the method.

Explanation / Answer

Hey, Name your class as sales.java and it should work correctly import java.io.*; class sales{ public static void main(String args[]) throws NumberFormatException, IOException { double ProductPrice, DiscountRate, price, com; BufferedReader file = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter Product Price: "); price = Double.parseDouble(file.readLine()); System.out.print("Enter Commission Rate: "); com = Double.parseDouble(file.readLine()); System.out.print("Enter Discount In Percentage: "); DiscountRate = Double.parseDouble(file.readLine()); sales calculate = new sales(); ProductPrice = calculate.sale(price,com,DiscountRate); System.out.println("The Percentage Is: "+ProductPrice); } double sale(double price, double commission, double discRate) { double productPrice = price * commission /100; double TotalPrice = price+productPrice; double DiscountPrice = TotalPrice * discRate/100; double actualPrice = TotalPrice - DiscountPrice; return actualPrice; } } Hope this helped.