Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class NumberTwo
- {
- public static void main(String[] args) {
- Scanner input = new Scanner (System.in);
- double loan, deposit = 0;
- System.out.println("Please enter your loan amount:$ ");
- loan = input.nextDouble();
- if (loan < 25000.00) {
- deposit = loan * 0.05;
- }
- else
- if (loan == 25000.00) {
- deposit = 1250.00;
- }
- else
- if (loan > 25000.00 && loan <= 49000.00) {
- deposit = (loan * 0.1) + 1250.00;
- }
- else
- if (loan == 50000.00) {
- deposit = 5000.00;
- }
- else
- if (loan > 50000.00 && loan <= 100000.00) {
- deposit = (loan * 0.25) + 5000.00;
- }
- else
- System.out.println("No loans over $100,000.00 is allowed.");
- System.out.println("Your required deposit is:$ " +deposit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement