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
Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
jek_recluse [69]

Answer:

oneMore(oneMore(oneMore(oneMore(oneMore(0)))))

Explanation:

  • As a function has been explained which when given an integer results as a next integer. oneMore(given-integer)= next integer
  • As we are restricted to use 0 only and can't use operators like + - * /.
  • We have to obtain a value 5
  • So doing step-by-step:

             (oneMore(0))=1

             (oneMore(oneMore(0)))=2

             (oneMore(oneMore(oneMore(0))))=3

             (oneMore(oneMore(oneMore(oneMore(0)))))=4

             oneMore(oneMore(oneMore(oneMore(oneMore(0)))))=5

7 0
3 years ago
How is IT related to new business initiatives?
wlad13 [49]

Answer:

Key Driver

Explanation:

Its undoubtedly the information that is most important for any new business initiatives. All these decisions are taken by Board of directors, and are being executed by the Chief Executive of the company.However, these are higher officials and are well educated to take decision from given refined information. The data need to be more clean for the Board of Directors as compared to the CEOs. The data must be more precise and more accurate for the higher authority, and like more precise for management as compared to the technical team. The reason is shortage of time.  Also what is information for technical team, is data for the management. And all this is made possible through IT, and subjects like Information Science, and various IT technologies.

7 0
3 years ago
A user reports that he cant browse to a specific website on the internet. From his computer, you find that a ping test to the We
ikadub [295]

Answer:

Incorrect DNS server address

Explanation:

7 0
1 year ago
Describe Mr. Digby, the principal. ​
Gennadij [26K]

Answer:

stinky

Explanation:

7 0
3 years ago
What protects original and creative expression of an idea?
alukav5142 [94]
A patent grants the right to sell an invention and claim it as your own
6 0
3 years ago
Read 2 more answers
Other questions:
  • The computers that run the DBMS and all devices that store database data should reside in locked, controlled-access facilities.
    15·1 answer
  • On hearing my name, you may think that I am iterative, but I play a vital role in networking by boosting the signal strength to
    13·1 answer
  • Ansel Adams education and special training
    14·1 answer
  • Why are ethics important in PR?
    8·1 answer
  • To implement a small database, a database designer must know the "1" and the "M" sides of each relationship and whether the rela
    13·1 answer
  • I live in Alabama and I’m ab to leave to go on a 3 week trip to France and I’m wondering how I can get LTE for my IPhone 6s Plus
    15·2 answers
  • Supp guees how your dayyyyyyyyyyyy
    10·2 answers
  • Assume that x and y are boolean variables and have been properly initialized. !(x || y) || (x || y) The result of evaluating the
    10·1 answer
  • Why would you browse by entering a URL rather than use a link in a Web page
    15·1 answer
  • Please help me with coding!
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!