desislava_topuzakova

08. Pet Shop

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