Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Ex1ChristmasSweets {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double BaklavaPrice = Double.parseDouble(scanner.nextLine());
- double MuffinsPrice = Double.parseDouble(scanner.nextLine());
- double ShtolenKg = Double.parseDouble(scanner.nextLine());
- double CandysKg = Double.parseDouble(scanner.nextLine());
- int BiscuitsKg = Integer.parseInt(scanner.nextLine());
- double ShtolenPrice = BaklavaPrice+BaklavaPrice*0.60; // или BaklavaPrice * 1.60
- double ShtolenSum = ShtolenKg*ShtolenPrice;
- double CandysPrice = MuffinsPrice+MuffinsPrice*0.80;
- double CandysSum = CandysKg*CandysPrice;
- double BiscuitsSum = BiscuitsKg*7.50;
- double FinalPrice = (ShtolenSum+CandysSum+BiscuitsSum);
- System.out.printf("%.2f", FinalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement