Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Test {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int lostGameCount = Integer.parseInt(scanner.nextLine());
- double headsetPrice = Double.parseDouble(scanner.nextLine());
- double mousePrice = Double.parseDouble(scanner.nextLine());
- double keyboardPrice = Double.parseDouble(scanner.nextLine());
- double displayPrice = Double.parseDouble(scanner.nextLine());
- int secondLost = lostGameCount /2;
- int thirdLost = lostGameCount / 3;
- int keybordTimesTrashed= lostGameCount/6;
- int displayTimesTrashed = lostGameCount/12;
- double trashedHeadset = secondLost * headsetPrice;
- double trashedMouse= thirdLost * mousePrice;
- double trashedKeybord=keybordTimesTrashed * keyboardPrice;
- double trashedDisplay = displayTimesTrashed * displayPrice;
- double totalSum= trashedHeadset+trashedMouse + trashedKeybord + trashedDisplay;
- System.out.printf("Rage expenses: %.2f lv.",totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement