-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRageExpenses_11.java
More file actions
21 lines (17 loc) · 833 Bytes
/
Copy pathRageExpenses_11.java
File metadata and controls
21 lines (17 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.Scanner;
public class RageExpenses_11 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int lostGames = 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 headset = lostGames/2;
int mouse = lostGames/3;
int keyboard = lostGames/6;
int display = lostGames/12;
double rageExpenses = (headset*headsetPrice)+(mouse*mousePrice)+(keyboard*keyboardPrice)+(display*displayPrice);
System.out.printf("Rage expenses: %.2f lv.",rageExpenses);
}
}