Answer:
import java.util.Scanner;
public class MoveEstimator
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
final int BASE_RATE = 200, RATE_PER_HOUR = 150, RATE_PER_MILE = 2;
int hours, miles;
double totalFee = 0.0;
System.out.print("Enter the number of hours for a job: ");
hours = input.nextInt();
System.out.print("Enter the number of miles: ");
miles = input.nextInt();
totalFee = BASE_RATE + (hours * RATE_PER_HOUR) + (miles * RATE_PER_MILE);
System.out.printf("For a move taking %d hours and going %d miles the estimate is $%.2f", hours, miles, totalFee);
}
}
Explanation:
*The code is in Java.
Create the Scanner object to be able to get input
Initialize the constant values using final keyword, BASE_RATE, RATE_PER_HOUR, RATE_PER_MILE
Declare the variables, hours, miles, totalFee
Ask the user to enter the hours and miles
Calculate the totalFee, add BASE_RATE, multiplication of hours and RATE_PER_HOUR, multiplication of miles and RATE_PER_MILE
Print the output as in required format