Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package FirstStepsInCoding.Exc.lab;
- import java.util.Scanner;
- public class FriutMarket {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- double strawberryBGN = Double.parseDouble(s.nextLine());
- double bananaKG = Double.parseDouble(s.nextLine());
- double orangeKG = Double.parseDouble(s.nextLine());
- double berryKG = Double.parseDouble(s.nextLine());
- double strawberryKG = Double.parseDouble(s.nextLine());
- double berryBGN = Double.parseDouble(s.nextLine());
- double orangeBGN = berryBGN - (0.4 * berryBGN);
- double bananaBGN = berryBGN - (0.8 * berryBGN);
- double berrySum = berryBGN * berryKG;
- double orangeSum = orangeBGN * orangeKG;
- double bananaSum = bananaBGN * bananaKG;
- double strawberrySum = strawberryBGN * strawberryKG;
- double totalSum = berrySum + orangeSum + bananaSum + strawberrySum;
- System.out.printf("%.4f", totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement