Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- getPrice(34,4);
- }
- private static void getPrice(int cost,int hour){
- int price = 0;
- int hours = 0;
- if (cost>=8 && 7*hour<=60){
- for (int i=0;i<30;i++){
- if (hours>=40){
- price+= (cost*1.5)*hour;
- }else
- price+= cost*hour;
- hours += hour;
- }
- }
- System.out.println(price + " $");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement