Project #29589 - Java HW2

  1. I just want to be clear that this is "one" assignment with multiple problems.  I need to know how much this in it's entirety will cost to do. If the person does well I will return with more work to be done.
  2. Problem 1

Imagine you are going on a trip with 2 of your best friends. You have decided to go to Tahiti.  So, you need to make airfare reservations, lodging and rental car reservations for 7 days and 6 nights.  After you make your reservations, you need to figure out if:

  1. Was everything totaled correctly? – (including airfare, lodging and rental car)
  2. How much would you each owe if you split the total evenly?
  3. Knowing that you it might not split evenly, determine what is left over.
  4. Finally, determine how much to set aside for food.  Print out a 15%, 20%, and 25% of the total cost for food.

Being a computer scientist, you whip out your computer and decide to write a program to do this for you.


  1. Read in three values – one for total airfare, one for total lodging, and one for rental car.
  2. Calculate the total.
  3. Split the total between the 3 of you.
  4. Determine if there’s anything left over after you split the check.
  5. Print out three different food values.


  1. Problem 2

You have decided you want to be one of the first people to live on Mars.  You have applied and been accepted.  So, you pack up all your belongings and put them on the ship.  However, soon after takeoff, you realize that all your measurements are going to be off because things aren’t measured in Standard English.  Luckily, you have about 18 months to come up with a way to convert everything.

First, you have to convert from lbs to Mars weight.  You know that if you weight 1 lb on Earth, you will weigh .38 lbs on Mars.  However, to make things more difficult, you meet a new friend and they are from Canada and they measure everything thing in metric units.  So, you need to create a conversion for them as well.


After living on Mars for a while, you decide to give Jupiter a try.  Again, you still want to track you weight so you have to convert from your Mars weight to your Jupiter weight and your Earth weight to Jupiter weight.  Remember you know that 1 lb (on Earth) equals 2.364 lbs on Jupiter.    Again, your Canadian friend travels with you and so you have to convert their weight from kilograms to Jupiter’s weight too.

Finally, after living there for a while, you get tired of all the people and you move to Pluto.  Again, convert your weight into Plutonian weight.  You know that 1 lb(on Earth) equals .067 lb on Pluto.  You decide it’s okay for your Canadian friend to tag along.  So, you will need to convert their weight too.

 Make sure you use good variable names and appropriate commenting.  Don’t forget about using constants.


  1. Get two weights from the user.
  2. Calculate their weight from Earth weight to Mars.
  3. Calculate weight from Earth to Jupiter and from Mars to Jupiter.
  4. Calculate weight from Earth to Pluto and Jupiter to Pluto.
  5. Don’t forget about your Canadian friend.


  1. Problem 3

Imagine you just received your tax refund check and you want to go to the bank and cash it right away.  You pull into the drive through, endorse your check and put it into the delivery tube.  The nice teller comes onto the speaker and asks how you would like to receive your bills.

Because you plan on going out tonight, you say, “How about fifties first”.

So, now the teller has to figure out how many twenties to give you along with the other denominations afterward.  After a while, you see the teller is struggling to put this all together, so you offer to write a quick program to figure it out for them.

So, you need to write a program that will accept any check amount and then calculate how many 50’s you should get first and then how many of the other bills and coins you should receive as well.

*** Note: If you use a really large number (i.e. over 1000, you may get inaccurate results)

For example, if your check is 174.34, then the program should print:

3 fifty dollar bills

1 twenty dollar bill

0 ten dollar bills

0 five dollar bills

4 one dollar bills

1 quarters

0 dimes

1 nickels

4 pennies

The next thought you have is, “wouldn’t your roll of cash look a lot bigger if you got it all in 5’s”.

Print out the previous breakdown again, but this time use the 5’s as the starting denomination and then the remaining change.  

Remember you do not need if statements to perform this.


  1. Problem 4

Write an applet that prints out 3 of your favorite music bands.

It should look something like this:

The Cure

       Atlas Genius


Embed a link to your applet in an HTML document and view it using a Web browser. For this problem you will need to turn in your HTML file too. (Make sure the applet class is in the same folder as your HTML file)

If you have trouble with Java Applets security settings on Windows, follow this link:


  1. Problem 5

You have been asked by a local hiking club to help write a program to estimate how long it will take hikers to travel along on of their trails.

You are to take in the name of the starting point, the end point, the distance between the two trailheads, the number of stops, the average speed for the whole trip, and the cost of the trip.

After you have collected all that information, you should calculate the total time it will take to travel between the two trailheads in Days, Hours, and Minutes.  Then, you should display how many miles they will travel between each stop and the cost per day.

You should display the results in the console that shows all the information on separate lines. Do not worry about formatting the numbers.

Remember to use the proper escape sequences to print the information on separate lines. (i.e. use Sytem.out.print to print information out)

Remember to use good naming conventions for your variables

Remember to use good commenting

You should not need any if/else statements to complete this problem.

Subject Computer
Due By (Pacific Time) 05/05/2014 12:00 am
Report DMCA

Chat Now!

out of 1971 reviews

Chat Now!

out of 766 reviews

Chat Now!

out of 1164 reviews

Chat Now!

out of 721 reviews

Chat Now!

out of 1600 reviews

Chat Now!

out of 770 reviews

Chat Now!

out of 766 reviews

Chat Now!

out of 680 reviews
All Rights Reserved. Copyright by - Copyright Policy