Create a Java Program to calculate baggage charges.

I’m studying and need help with a Java question to help me learn.

Here are the rules:

A. Two bags per person are free.
B. The Excess Bag Charge is $75 per bag.

Your program needs to do the following:

1. In your main method(),

  1. Create integers to store the number of Passengers and also the total number of bags
  2. Prompt for the number of passengers on a ticket.
  3. Prompt for the total number of bags for all passengers on a ticket.

2. From the main() method:

  1. Pass the number of passengers and the number of bags to a value method named “calculateMyBaggageFees”. This method needs to determine the number of free bags allowed. A bag count over the free count should be multiplied by the Excess Bag Charge.

3. In the method calculateMyBaggageFees:

  1. Using the passed passenger count and bag count, calculate the total excess bag fee and return that amount as a double variable. If the result is negative, return 0.

3. In the main() method, display the cost for baggage. This is only possible if the method calculateMyBaggageFees is a value method.

Example Input/Output

Enter number of passengers on your ticket:2
Enter number of bags for this ticket:5
The cost for baggage will be $75.00

Grading item: Avoid using Magic Numbers


Answering this question is not essay as it seems. It will require you to research or burn your brain power, write your findings down, edit, proofread severally, and submit unsure of the grade you will get. assignment writers are offering to take care of that. Order your assignment now, relax, submit, and enjoy excellent grades. We guarantee you 100% original answers, timely delivery, and some free products.



Posted in Uncategorized