BubaLazi

VegieStore

Dec 20th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class VegieStore {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.  
  7.         System.out.print("Цена на плодове: ");
  8.         double fruitPrice = Double.parseDouble(console.nextLine());
  9.         System.out.print("Цена на зеленчуци: ");
  10.         double vegiePrice = Double.parseDouble(console.nextLine());
  11.         System.out.print("Въведете количество плодове: ");
  12.         int fruitKilos = Integer.parseInt(console.nextLine());
  13.         System.out.print("Въведете количество зеленчуци: ");
  14.         int vegieKilos = Integer.parseInt(console.nextLine());
  15.  
  16.         double fruitProfit = (fruitPrice * fruitKilos)/1.94;
  17.         double vegieProfit = (vegiePrice * vegieKilos)/1.94;
  18.         double profit = fruitProfit + vegieProfit;
  19.         System.out.print("Общо печалба " + profit);
  20.  
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment