Ask Question
31 July, 04:43

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. 31 July, 04:55
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers