Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package L01_FirstStepsInCoding_EXC;
- import java.util.Scanner;
- public class P08_BasketballEquipment {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //1. Пресметнем цената за екипировката -> цена за кецове, цена за екип, цена за топка и цена за аксесоари
- //2. Пресметнем общата сума
- //3. Принтираме
- // • Баскетболни кецове – цената им е 40% по-малка от таксата за една година
- //• Баскетболен екип – цената му е 20% по-евтина от тази на кецовете
- //• Баскетболна топка – цената ѝ е 1 / 4 от цената на баскетболния екип
- //• Баскетболни аксесоари – цената им е 1 / 5 от цената на баскетболната топка
- int feePerYear = Integer.parseInt(scanner.nextLine());
- double trainersPrice = feePerYear - (feePerYear * 0.4);// feePerYear * 0.6
- double suitPrice = trainersPrice - (trainersPrice * 0.2); //trainersPrice * 0.8
- double ballPrice = suitPrice / 4;
- double accessoriesPrice = ballPrice / 5;
- double totalSum = feePerYear + trainersPrice + suitPrice + ballPrice + accessoriesPrice;
- System.out.println(totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment