Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Exam {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- double period = Integer.parseInt(sc.nextLine());
- double commision = Integer.parseInt(sc.nextLine());
- double rentFee = Integer.parseInt(sc.nextLine());
- var firstHalf = Math.floor(period / 2);
- var secondHalf = period - firstHalf;
- var rent = firstHalf * rentFee + secondHalf * (rentFee - rentFee * 0.2);
- var totalSum = rent + rent * (commision / 100);
- System.out.printf("Total: %.2f", totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement