deyanivanov966

EXAM 31.10 // 01. Christmas Preparation

Oct 31st, 2020 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Izpit01 {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int BROpHartiq = Integer.parseInt(scanner.nextLine());
  10.         int BRPlat = Integer.parseInt(scanner.nextLine());
  11.         double LitriLepilo = Double.parseDouble(scanner.nextLine());
  12.         int ProcentNamalenie = Integer.parseInt(scanner.nextLine());
  13.  
  14.         double CenaHartiq = BROpHartiq * 5.80;
  15.         double CenaPlat = BRPlat * 7.20;
  16.         double CenaLepilo = LitriLepilo * 1.20;
  17.         double CenaMateriali = CenaHartiq+CenaPlat+CenaLepilo;
  18.         double Namalenie = (CenaMateriali / 100) * ProcentNamalenie;
  19.         double FinalnaCena = CenaMateriali - Namalenie;
  20.  
  21.         System.out.printf("%.3f", FinalnaCena);
  22.     }
  23. }
  24.  
Add Comment
Please, Sign In to add comment