Malcolm Movers charges a base rate of $200 per move plus $150 per hour and $2 per mile. Write a program named MoveEstimator that prompts a user for and accepts estimates for the number of hours for a job and the number of miles involved in the move and displays the total moving fee. For example, if 25 hours and 55 miles are input the output would be displayed as: For a move taking 25 hours and going 55 miles the estimate is $4,060.00 The input is 99 and 55 the answer must display as $4060.00
import java.util.Scanner;
public class MoveEstimator {
public static void main(String[] args) {
int total=0;
Scanner sc = new Scanner(System.in);
System.out.println("Enter number of hours for movie:
");
int hours=sc.nextInt();
System.out.println("Enter number of mile involed in
Movie");
int miles=sc.nextInt();
total=200; // adding base price;
total=total+hours*150; //adding the price hours. where
each hour takes 150$
total=total+miles*2; //adding the price miles. where
each mile takes 2$
System.out.println("Total: $"+total);
}
}
Note : If you like my answer please rate and help me it is very Imp for me
Get Answers For Free
Most questions answered within 1 hours.