Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Schoolstaff {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double pencilPrice = 5.80;
- double markerPrice = 7.20;
- double litre = 1.20;
- int pencilPackages = Integer.parseInt(scanner.nextLine());
- int markerPackages = Integer.parseInt(scanner.nextLine());
- double litreClean = Double.parseDouble(scanner.nextLine());
- int discount = Integer.parseInt(scanner.nextLine());
- double pencilPr = pencilPrice * pencilPackages;
- double markerM = markerPackages * markerPrice;
- double clean = litre * litreClean;
- double allPrice = (pencilPr + markerM + clean);
- double discount1 = allPrice - ((allPrice * discount) / 100);
- System.out.printf("%.3f",discount1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement