Advertisement
Spocoman

PC Store

Sep 9th, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double processorPrice = Double.parseDouble(scanner.nextLine()),
  7.                 videoPrice = Double.parseDouble(scanner.nextLine()),
  8.                 ramPrice = Double.parseDouble(scanner.nextLine());
  9.         int ramCount = Integer.parseInt(scanner.nextLine());
  10.         double discount = Double.parseDouble(scanner.nextLine()), USDToBGN = 1.57,
  11.                 sum = ((processorPrice + videoPrice) * (1 - discount) + ramPrice * ramCount) * USDToBGN;
  12.  
  13.         System.out.printf("Money needed - %.2f leva.\n", sum);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement