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);
}}
Explanation:
For explanation purpose, let
[tex]MP \to[/tex] Marked Price
[tex]\%D \to[/tex] Percentage discount
[tex]D \to[/tex] Discounted amount
[tex]\%P \to[/tex] Percentage Profit
[tex]C \to[/tex] Cost Price
The marked price (i.e. selling price) is calculated discount using:
[tex]MP = \frac{D}{\%D}[/tex]
The derived formula of the cost price from percentage profit and Marked Price is:
[tex]C = \frac{M}{1 + \%P * 100}[/tex]
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);