Advertisement
veronikaaa86

08. Pet Shop

May 8th, 2021
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package com.company;
  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.  
  9.         int countDogs = Integer.parseInt(scanner.nextLine());
  10.         int countAnimals = Integer.parseInt(scanner.nextLine());
  11.  
  12.         double allDogsFood = countDogs * 2.50;
  13.         double allAnimalsFood = countAnimals * 4.00;
  14.  
  15.         double sum = allDogsFood + allAnimalsFood;
  16.  
  17.         System.out.println(sum + " lv.");
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement