Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A rent-a-car company has the following system for computing a customer\'s rental

ID: 3869696 • Letter: A

Question

A rent-a-car company has the following system for computing a customer's rental car bill. Design the pseudocode and write the Java program for the following The daily rate includes 150 free miles per day, and the weekly rate includes 1000 free miles per week. An additional 25 cents is charged for each mile above the free miles. a. Passenger collision insurance is optional and costs $3.75 per day for cars rented by the day /$26.25 per week for cars rehted by the week. b. Destination extra charges: There is no extra charge if the vehicle is returned to the renting station; however, if the receiving station is not the renting station, there is an additional c. ha 1venndihr d. The final invoice should also include a 4% sales tax. The cars are rented based on car type. The user will enter the car type (compact, medium or luxury) e. Car Type: Compact $15 per day/$90 per week Medium sized $17 per day/$100 per week Luxury $19 per day/$120 per week Design a program and write the Java code to compute a customer's bill, based on the charges described above.

Explanation / Answer

Hi,
This is just a test of the code branching, using if else, we can use the code like below,
pseudo code
type=ask user for car type;
rental= ask user for day or week rent
totalmiles=ask user for total miles
if(type==day)
{
if(type is compact)
bill+=15
else if(type is medium)
bill+=17
else
bill+=19
/* prompt for collision insurance */
if(yes)
bill+=3.75
if(totalmiles>150)
bill+=0.25*totalmiles

}
else if(type == week)
{
    if(type is compact)
bill+=90
else if(type is medium)
bill+=100
else
bill+=120
  /* prompt for collision insurance */
if(yes)
bill+=26.25
if(totalmiles>1000)
bill+=0.25*totalmiles

}
bill+=0.4*bill //sales tax
print bill
Thumbs up if this was helpfulm otherwise let me know in comments

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote