Advertisement
Spocoman

08. Pet Shop

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