Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Exam_26_March_2016 - created by borkins on 2017-05-14.
- */
- import java.text.DecimalFormat;
- import java.util.Scanner;
- public class _01_VegetablesMarket
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- DecimalFormat df = new DecimalFormat(".#############");
- double vegPriceKg = Double.parseDouble(console.nextLine());
- double fruPriceKg = Double.parseDouble(console.nextLine());
- int vegetablesKg = Integer.parseInt(console.nextLine());
- int fruitsKg = Integer.parseInt(console.nextLine());
- double vegProfits = vegetablesKg * vegPriceKg;
- double fruProfits = fruitsKg * fruPriceKg;
- double profitsEuro = (vegProfits + fruProfits) / 1.94;
- System.out.println(df.format(profitsEuro));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment