Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double salary = Double.parseDouble((scanner.nextLine()));
- int months = Integer.parseInt((scanner.nextLine()));
- double minimalCosts = Double.parseDouble((scanner.nextLine()));
- double monthlySavings = salary * 0.70 - minimalCosts;
- System.out.printf("She can save %.2f%%\n%.2f", monthlySavings / salary * 100, monthlySavings * months);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement