Answer:
The program in Java is as follows:
public class Main{
public static void main(String[] args) {
double discount_percent = 0.15;
double discount_amount = 600;
double profit = 0.20;
double marked_price = discount_amount/discount_percent;
double cost_price = marked_price/(1 + profit);
System.out.println("Marked Price: "+marked_price);
System.out.println("Cost Price: "+cost_price);
}}
Step-by-step explanation:
For explanation purpose, let
Marked Price
Percentage discount
Discounted amount
Percentage Profit
Cost Price
The marked price (i.e. selling price) is calculated discount using:
![MP = (D)/(\%D)](https://img.qammunity.org/2022/formulas/computers-and-technology/high-school/dne6ra47epb5jx0i7k7g8jmfpm5yfbcnfl.png)
The derived formula of the cost price from percentage profit and Marked Price is:
![C = (M)/(1 + \%P * 100)](https://img.qammunity.org/2022/formulas/computers-and-technology/high-school/tcyqxip8cjecfwoc6vltg7drlf4u1i9eld.png)
So, the explanation is as follows:
The next three lines declare and initialize the given parameters
double discount_percent = 0.15;
double discount_amount = 600;
double profit = 0.20;
Calculate marked price
double marked_price = discount_amount/discount_percent;
Calculate cost price
double cost_price = marked_price/(1 + profit);
Print marked price
System.out.println("Marked Price: "+marked_price);
Print Cost price
System.out.println("Cost Price: "+cost_price);