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]
2 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:
jeka942 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
                                                       HELP PLEASE 
Marina CMI [18]
Your answer should be mode







5 0
3 years ago
Read 2 more answers
How is the numeric string that makes up a digital signature created?
Nat2105 [25]
<span>A numeric string is created by a cryptographic algorithm, which is called a hash that is used to validity of a message or authenticity of a document. The signature is verified by an algorithm that uses the stated owner of the signature's public key to accept or reject the authenticity of a signature. A certification authority's digital signature is used to verify the authenticity of digital certificates and other documents in a PKI.</span>
7 0
3 years ago
100 points, PLEASE HELP...To generate numbers between and including -10 to 10 you would use:
Orlov [11]

Answer:

A number line?

6 0
3 years ago
Which of the following correctly stores 45 squared in the variable x?
timama [110]

Answer:

x = 45

x = x ** 2

6 0
3 years ago
What are the set of rules to move data from one computer to another?
ss7ja [257]
I don't believe that there are rules.
Hope I helped,
 Ms. Weasley
4 0
3 years ago
Other questions:
  • What does delegating access give someone the permission to do on behalf of the user? Choose two answers.
    5·1 answer
  • Calls to the tostring( ) method emphasize the use of ____.
    12·1 answer
  • How do I learn coding??? ​
    5·2 answers
  • What is renewable energy
    13·2 answers
  • _____ lets you look at two documents at the same time.
    14·1 answer
  • Which symbol is at the beginning and end of a multiline comment block? &amp;&amp;&amp; """ %%% ###
    5·1 answer
  • Select the correct answer.
    10·1 answer
  • You can't cite Wikipedia, what are three ways that you can use it for your research?
    5·1 answer
  • Which of the following is true about parallel computing performance?
    11·1 answer
  • The first time that a particular visitor loads a web site page is called a(n) _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!