Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem 1 : New Wave Sale
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { System.out.println(phones(2)); } public static double phones(int q) { if(q == 1) { double discount = 1299.5-(1299.5*0.05); return discount + (discount*0.06); } if(q == 2) { double discount = (2*1299.5)-((2*1299.5)*0.11); return discount + (discount*0.06); } if(q == 3) { double discount = (3*1299.5)-((3*1299.5)*0.20); return discount + (discount*0.06); } if(q == 4) { double discount = (4*1299.5)-((4*1299.5)*0.30); return discount + (discount*0.06); } if(q >= 5) { double discount = (q*1299.5)-((q*1299.5)*0.75); return discount + (discount*0.06); } return 1; } }
run
|
edit
|
history
|
help
0
AVL-GO-FLAT
Tree_inorder_recursive
Item battle rolyal
Jh
Kochergina_1
Геттеры и сеттеры для класса Dog
preincrement1
Happy Numbers in Java
Bubble Sort Java 2
pattern of the day (code formatting fixed)