Advertisement
CoineTre

PreExam11/20_01Programming Book

Nov 17th, 2020 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ProgrammingBook {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double pricePerPage = Double.parseDouble(scanner.nextLine());
  7.         double pricePerCover = Double.parseDouble(scanner.nextLine());
  8.         int discountBook = Integer.parseInt(scanner.nextLine());
  9.         double sumDesigner = Double.parseDouble(scanner.nextLine());
  10.         double teamMoney = Double.parseDouble(scanner.nextLine());
  11.         int bookPages = 899;
  12.         int covers = 2;
  13.         double bookCalculationPrice = pricePerPage * bookPages + pricePerCover *covers;
  14.         double bookWithDiscount = bookCalculationPrice*(1- 1.0*discountBook/100);
  15.         double sumWithDesignerExpenses = bookWithDiscount + sumDesigner;
  16.         double finalSumBook = sumWithDesignerExpensis *(1-teamMoney/100);
  17.         System.out.printf("Avtonom should pay %.2f BGN.",finalSumBook);
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement