Ask Question
18 January, 04:07

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.

+3
Answers (1)
  1. 18 January, 04:13
    0
    Logic:

    profit = retailPrice - wholeSalePrice

    salePrice = retailPrice - (0.25 * retailPrice)

    saleProfit = salePrice - wholeSalePrice

    Java code:

    double retailPrice, wholeSalePrice;

    double profit = retailPrice - wholeSalePrice;

    double salePrice = retailPrice - (0.25 * retailPrice);

    double saleProfit = salePrice - wholeSalePrice;

    Explanation:

    The logic just represented the words in equation format. That is, profit is retailPrice minus wholesaleprice.

    SalePrice is 25% deducted from retail price.

    SaleProfit is saleprice minus wholesaleprice.

    The whole logic is then represented in Java assignment statement using type double.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Design the logic and write the Java code that will use assignment statements to: Calculate the profit (profit) as the retail price minus ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers