Answer:
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.