Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ExamPrepTwo;
- import java.util.Scanner;
- public class PCStore {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double priceCPU = Double.parseDouble(scanner.nextLine());
- double priceVC = Double.parseDouble(scanner.nextLine());
- double priceRam = Double.parseDouble(scanner.nextLine());
- int countRam = Integer.parseInt(scanner.nextLine());
- double discount = Double.parseDouble(scanner.nextLine());
- double lvCPU = priceCPU * 1.57;
- double discountCPU = lvCPU - (lvCPU * discount);
- double lvVC = priceVC * 1.57;
- double discountVC = lvVC - (lvVC * discount);
- double lvRam = (priceRam * 1.57) * countRam;
- double totalSum = discountCPU + discountVC + lvRam;
- System.out.printf("Money needed - %.2f leva.", totalSum);
- }
- }
Add Comment
Please, Sign In to add comment