Advertisement
thotfrnk

selection1

Nov 11th, 2022
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class NumberOne
  3. {
  4.     public static void main(String[] args) {
  5.        
  6.         Scanner input = new Scanner (System.in);
  7.        
  8.         double cost, remainder, firstFee, fee, finalFee = 0;
  9.         final double firstCost = 5000.00;
  10.        
  11.         System.out.println("Please enter the cost of the building: ");
  12.         cost = input.nextDouble();
  13.        
  14.         firstFee = firstCost * 0.08;
  15.        
  16.         remainder = cost - firstCost;
  17.        
  18.         if (remainder <= 80000.00) {
  19.             fee = remainder * 0.03;
  20.         }
  21.         else
  22.              fee = remainder * 0.025;
  23.              
  24.         finalFee = finalFee + fee;
  25.        
  26.         System.out.println("The fee is: " +finalFee);
  27.     }
  28. }
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement