Practice2021/Sale.java

17 lines
339 B
Java
Raw Normal View History

2021-10-30 18:44:18 +02:00
public class Sale {
public static void main(String[] args) {
discount(89, 20);
}
public static double discount(int price, int percentage) {
double a = price / 100.00 * percentage;
System.out.println(a);
double sale = price - a;
System.out.println(sale);
return sale;
}
}