Advertisement
veronikaaa86

08. Pet Shop

May 13th, 2023
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 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 countDog = Integer.parseInt(scanner.nextLine());
  10.         int countCat = Integer.parseInt(scanner.nextLine());
  11.  
  12.         double onePackDog = 2.50;
  13.         double onePackCat = 4;
  14.  
  15.         double totalDog = countDog * onePackDog;
  16.         double totalCat = countCat * onePackCat;
  17.  
  18.         double totalSum = totalCat + totalDog;
  19.  
  20. //        System.out.printf("%f lv.", totalSum);
  21.         System.out.println(totalSum + " lv.");
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement