Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int lostgames = Integer.parseInt(sc.nextLine());
- double headsetPrice = Double.parseDouble(sc.nextLine());
- double mousePrice = Double.parseDouble(sc.nextLine());
- double kbPrice = Double.parseDouble(sc.nextLine());
- double displayPrice = Double.parseDouble(sc.nextLine());
- int hsCrash = lostgames / 2;
- int msCrash = lostgames / 3;
- int kbCrash = lostgames / 6;
- int dispCrash = lostgames / 12;
- double totalPrice = hsCrash * headsetPrice + msCrash * mousePrice + kbCrash * kbPrice + dispCrash * displayPrice;
- System.out.printf("Rage expenses: %.2f lv.", totalPrice);
- }
- }
Add Comment
Please, Sign In to add comment