Advertisement
yovkovbpfps

EXAM 20-21 APRIL 2019 Easter Lunch

Apr 26th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class EasterLunch {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int cake = Integer.parseInt(scanner.nextLine());
  8. int eggs = Integer.parseInt(scanner.nextLine());
  9. int sweets = Integer.parseInt(scanner.nextLine());
  10.  
  11. double cakePrice = cake * 3.20;
  12. double eggsNum = eggs * 4.35;
  13. double sweetsPrice = sweets * 5.40;
  14. double eggsPaint = eggs * 12 * 0.15;
  15. double count = cakePrice + eggsNum + sweetsPrice + eggsPaint;
  16.  
  17. System.out.printf("%.2f",count);
  18.  
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement