Advertisement
MladenPetrov

Rage expenses

Sep 20th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class RageExpenses {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int lostGames = scanner.nextInt();
  8.         double headsetPrice = scanner.nextDouble();
  9.         double mousePrice = scanner.nextDouble();
  10.         double keybordPrice = scanner.nextDouble();
  11.         double displayPrice = scanner.nextDouble();
  12.  
  13.         double totalPrice = (lostGames / 2) * headsetPrice + (lostGames / 3) * mousePrice + (lostGames / 6) * keybordPrice + (lostGames / 12) * displayPrice;
  14.  
  15.         System.out.printf("Rage expenses: %.2f lv.", totalPrice);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement