Question: Complete a partially written Java program that is provided for you. The program, which was written for a furniture company, prints the name of the
Complete a partially written Java program that is provided for you. The program, which was written for a furniture company, prints the name of the furniture item, its retail price, its wholesale price, the profit made on the piece of furniture, a sale price, and the profit made when the sale price is used.
Instructions
- Ensure the file named Furniture.java is open.
- The file includes variable declarations and output statements. Read them carefully before you proceed to the next step.
- Design the logic and write the Java code that will use assignment statements to:
- Calculate the profit (profit) as the retail price minus the wholesale price
- Calculate the sale price (salePrice) as 25 percent deducted from the retail price
- Calculate the sale profit (saleProfit) as the sale price minus the wholesale price.
-
Execute the program by clicking Run. Your output should be as follows:
Item Name: TV Stand Retail Price: $325 Wholesale Price: $200 Profit: $125 Sale Price: $243.75 Sale Profit: $43.75


5 6 7 1 // This program calculates profits and sales prices for a furniture company. 2 3 public class Furniture 4 { public static void main(String args[]) { String itemName = "TV Stand"; 8 double retailPrice = 325.00; double wholesalePrice = 200.00; 10 double salePrice; 11 double profit; 12 double saleprofit; 13 14 // Write your assignment statements here. 15 9 16 17 18 19 20 21 System.out.println("Item Name: " + itemName); System.out.println("Retail Price: $" + retailPrice); System.out.println("Wholesale Price: $" + wholesalePrice); System.out.println("Profit: $" + profit); System.out.println("Sale Price: $" + salePrice); System.out.println("Sale Profit: $" + saleProfit); System.exit(); 22 23 24 25 26 27 System.exit()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
