Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class VegieStore {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- System.out.print("Цена на плодове: ");
- double fruitPrice = Double.parseDouble(console.nextLine());
- System.out.print("Цена на зеленчуци: ");
- double vegiePrice = Double.parseDouble(console.nextLine());
- System.out.print("Въведете количество плодове: ");
- int fruitKilos = Integer.parseInt(console.nextLine());
- System.out.print("Въведете количество зеленчуци: ");
- int vegieKilos = Integer.parseInt(console.nextLine());
- double fruitProfit = (fruitPrice * fruitKilos)/1.94;
- double vegieProfit = (vegiePrice * vegieKilos)/1.94;
- double profit = fruitProfit + vegieProfit;
- System.out.print("Общо печалба " + profit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment