Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.text.NumberFormat;
- public class HomeworkLabfour {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- NumberFormat fmt = NumberFormat.getCurrencyInstance();
- double rate1, rate2;
- rate1 = .25;
- rate2 = .15;
- Scanner in = new Scanner(System.in);
- System.out.println("Enter Miles");
- int miles = in.nextInt();
- if(miles <= 100)
- System.out.println("The Amount owed= $" + (rate1 * miles));
- else{
- System.out.println("The Amount owed= $" + (miles * rate1) + (miles * rate2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement