Driver code
public static void main ( String args [ ] ) { int SP , profit , loss ; SP = 1020 ; profit = 20 ; System . out . println ( " Cost ▁ Price ▁ = ▁ " + CPwithProfit ( SP , profit ) ) ; SP = 900 ; loss = 10 ; System . out . println ( " Cost ▁ Price ▁ = ▁ " + CPwithLoss ( SP , loss ) ) ; SP = 42039 ; profit = 8 ; System . out . println ( " Cost ▁ Price ▁ = ▁ " + CPwithProfit ( SP , profit ) ) ; } }