Final answer:
To code the logic for calculating profit, sale price, and sale profit in a C program, use assignment statements to find the differences between retail and wholesale prices and apply a discount for the sale price.
Step-by-step explanation:
In the context of a partially written C program for a furniture company, the necessary code to calculate the profit, sale price, and sale profit from given retail and wholesale prices is as follows:
To calculate the profit, subtract the wholesale price from the retail price:
profit = retailPrice - wholesalePrice;
To calculate the sale price, deduct 25 percent from the retail price:
salePrice = retailPrice * 0.75;
Lastly, to calculate the sale profit, subtract the wholesale price from the sale price:
saleProfit = salePrice - wholesalePrice;
When you execute the program with a retail price of $325 and a wholesale price of $200, your output will match the provided example, with a profit of $125, a sale price of $243.75, and a sale profit of $43.75.