Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo1 {
- public static void main(String[] agrs) {
- Scanner scanner = new Scanner(System.in);
- int paper = Integer.parseInt(scanner.nextLine());
- int fabric = Integer.parseInt(scanner.nextLine());
- double glue = Double.parseDouble(scanner.nextLine());
- int discount = Integer.parseInt(scanner.nextLine());
- double paperPrice = paper * 5.80;
- double fabricPrice = fabric * 7.20;
- double gluePrice = glue * 1.20;
- double totalSum = paperPrice + fabricPrice + gluePrice;
- //36.20 – ((36.20 * 25) / 100) = 27.150
- double result = totalSum - ((totalSum * discount) / 100);
- System.out.printf("%.3f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement