1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leona [35]
3 years ago
5

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
Computers and Technology
1 answer:
jeka943 years ago
6 0

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

You might be interested in
Which features must you remove from a full gui installation of windows server 2012 r2 to convert it to a server core installatio
jok3333 [9.3K]

Graphical management tools and infrastructure, Server graphical shell
5 0
3 years ago
Write any four causes of cyber crime
jenyasd209 [6]
A Lack of Empathy
The Victim Deserves It
Self-loathing
It Becomes an Addiction
7 0
3 years ago
What does PRAM stand for?
Nana76 [90]
<span>PRAM- Phase-Change Random Access Memory</span>
7 0
3 years ago
Read 2 more answers
**PLEASE AN IPO CHART AND A C++ PROGRAM FOR EACH QUESTION**
Yuki888 [10]

answer is b

rtyujhygtrcdxrtgyhgtfr

7 0
3 years ago
What makes this information systems environment unique? (3 points)
QveST [7]

Information technologies are unique not just because of their growing use in decision-making and knowledge management systems, important as that is. Their use has also yielded significant improvements in the efficiency of energy and materials use.

6 0
3 years ago
Other questions:
  • Which data type stores images and audio visual clips?
    9·2 answers
  • When you’re in the Normal view, what are the visible panes?
    15·2 answers
  • How do airbags prevent injury?
    13·1 answer
  • ABC software company is to develop software for effective counseling for allotment of engineering seats for students with high s
    13·1 answer
  • Assume that another method has been defined that will compute and return the student's class rank (Freshman, Sophomore, etc). It
    8·1 answer
  • Prewritten, commercially available sets of software programs that eliminate the need for a firm to write its own software progra
    7·1 answer
  • Areas on which the development of the computer as a communication technology is based
    5·1 answer
  • Question 4
    5·1 answer
  • How do you convert an algorithm to make it possible for a computer to read
    6·1 answer
  • The recipient list cannot be edited.<br> Group of answer choices<br><br> True<br><br> False
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!