Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Izpit;
- import java.util.Scanner;
- public class ChristmasPreparation {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double paperPrice = 5.80;
- double clothPrice = 7.80;
- double gluePrice = 1.20;
- int paperRolls = Integer.parseInt(scanner.nextLine());
- int clothRolls = Integer.parseInt(scanner.nextLine());
- double glue = Double.parseDouble(scanner.nextLine());
- int discount = Integer.parseInt(scanner.nextLine());
- double pricePaperRolls = paperPrice * paperRolls;
- double priceClothRolls = clothPrice * clothRolls;
- double priceGlue = gluePrice * glue;
- double totalPrice = pricePaperRolls + priceClothRolls + priceGlue;
- double priceWithDiscount = totalPrice*(discount/100);
- System.out.printf("Money needed: %.3f", priceWithDiscount);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement