Problem

Arithmetic and Assignment Operator In this lab, you complete a partially written Java...

Arithmetic and Assignment Operator

In this lab, you complete a partially written Java program that is provided along with the data files for this book. 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.

1. Open the file named Furniture. java using Notepad or the text editor of your choice.

2. The file includes variable declarations and output statements. Read them carefully before you proceed to the next step.

3. Design the logic that will use assignment statements to first calculate the profit, then calculate the sale price, and finally calculate the profit when the sale price is used. Profit is defined as the retail price minus the wholesale price. The sale price is 25 percent deducted from the retail price. The sale profit is defined as the sale price minus the wholesale price. Perform the appropriate calculations as part of your assignment statements.

4. Save the source code file in a directory of your choice, and then make that directory your working directory.

5. Compile the program.

6. Execute the program. Your output should be as follows:

• Item Name: TV Stand

• Retail Price: $325.0

• Wholesale Price: $200.0

• Profit: $125.0

• Sale Price: $243.75

• Sale Profit: $43.75

Next, you will see how to put together all you have learned in this chapter to write a Java program that uses sequential statements, comments, and interactive input statements.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT