Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package W01FirstStepsInCoding.Exercises;
- import java.util.Scanner;
- public class P08BasketballEquipment {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int feePerYear = Integer.parseInt(scanner.nextLine());
- //Пресмятаме цената за кецове, екип, топка, аксесоари
- double trainersPrice = feePerYear - feePerYear * 0.40; // feePerYear * 0.60
- double suitPrice = trainersPrice - trainersPrice * 0.20; //trainersPrice * 0.80
- double ballPrice = suitPrice / 4;
- double accessoriesPrice = ballPrice / 5;
- // Пресмятаме общата сума за разходи
- // => год. такса + цена за кецове + цена за екип + цена за топка + цена за аксесоари
- double finalPrice = feePerYear + trainersPrice + suitPrice + ballPrice + accessoriesPrice;
- System.out.println(finalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement