Ask Question
19 September, 06:52

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.

+2
Answers (1)
  1. 19 September, 10:03
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers