Advertisement
myrdok123

08. Pet Shop

Mar 9th, 2024
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PetShop {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int countDogPacks = Integer.parseInt(scanner.nextLine());
  8.         int countCatPacks = Integer.parseInt(scanner.nextLine());
  9.  
  10.         double priceDogFood = countDogPacks * 2.50;
  11.         double priceCatFood = countCatPacks * 4;
  12.  
  13.         double totalPrice = priceCatFood + priceDogFood;
  14.  
  15.         System.out.println(totalPrice + " lv.");
  16.  
  17.  
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement