Advertisement
SotirovG

PetShop_08

Oct 28th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. package FirstStepsInCodingLab;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Pet_Shop_08 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.          //1. Броят на кучетата – цяло число в интервала
  9.         //2. Броят на останалите животни  - цяло число в интервала
  10.         double dogFood = 2.50;
  11.         double anotherFood = 4;
  12.  
  13.         double dogs = Double.parseDouble(scanner.nextLine());
  14.         double restAnimals = Double.parseDouble(scanner.nextLine());
  15.  
  16.         double dogSum = dogFood * dogs;
  17.         double restAnimalSum = anotherFood * restAnimals;
  18.         double endSum = dogSum + restAnimalSum;
  19.  
  20.         System.out.printf( " %.1f lv.",endSum );
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement