desislava_topuzakova

4. Zoo Shop

Oct 24th, 2021
588
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class ZooShop_04 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int countDogs = Integer.parseInt(scanner.nextLine());
  8.         int countOthers = Integer.parseInt(scanner.nextLine());
  9.  
  10.         //разходи = бр. кучета * 2.50 + бр. останалите * 4
  11.         double expenses = (countDogs * 2.50) + (countOthers * 4);
  12.        // System.out.printf("%f lv.", expenses);
  13.         System.out.println(expenses + " lv.");
  14.     }
  15. }
  16.  
RAW Paste Data