CSE 20 : Project #1 solution

$24.99

Original Work ?

Download Details:

  • Name: Project1-1.zip
  • Type: zip
  • Size: 238.23 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (2 votes)

This is our first project requiring you to use everything we have done so far in the class. Create a new class called Bobcar (Bobcar.java) to do all your work. You may work in pairs or by yourself. The expectation is that you work on the project outside of lab time but you may certainly use any extra time in lab this week. Your partner can be in any section, both of you will make your own submission while noting your collaborator/partner in the text box of the submission. We have included sample runs to give you a better idea of how the program works given the project requirements. Refer to your previous lab assignments for hints on how to approach this project. You can ask the TAs or the instructor for clarifications and help. This project is worth 60 points so be sure to complete it. Submit Bobcar.java for this project in the assignment page after properly formatting it with instructions below on how-to inside Eclipse. Problem: You have been hired by Bobcar Rent-a-Car to provide a self-service computer program, which will provide an estimated cost for a rental car. Bobcar has 3 classes of cars, which are as follows: Economy: $35 per day Compact: $45 per day Standard: $95 per day You need to write a program that asks the user for the following Type of car they want How many days they want to rent the car Whether they are a club member If yes then whether they want the “Platinum Executive Package” Note that the question about the Platinum Executive Package only applies to club members. Then calculate the estimate cost for the customer using the following rules and print it out accordingly.
Calculate the base price for the rental, by multiplying the cost of one day by the number of days. If the user is a club member, calculate the discount based on how many multiples of 7 days they are renting. Any remaining days which are not multiples of 7 do not count towards the discount. For example: If rental is for 10 days, discount is 1 days cost. If rental is for 17 days, discount is 2 days cost. If rental is for 6 days, discount is 0. If the user wanted Platinum Executive Package, calculate the cost of the package by multiplying the base price by 15%. Calculate the estimated total, which is the base cost, minus the discount (if any) and plus the Platinum cost (if any). Finally, print out the final amounts of the estimate, showing the base cost, any extra costs, and estimated total. If the user is not a club member then discount line should not appear in the estimate. If the user did not ask for the Platinum service then additional cost should not appear. Before you submit, do ctrl-a (to select everything) and ctrl-i (to fix the indentation) on Bobcar.java Output indenting does not have to have identical spacing as the sample runs. However, your text should be the same as stated (do not take short cuts and lose easy points)
Sample Output Runs: Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 1 Please enter the number of rental days: 3 Club member?: 1 for yes, 0 for no: 1 Platinum Executive Package?: 1 for yes, 0 for no: 1 Base: 3 days for a Economy @ $35 per day: $ 105 Club Member Discount: – $ 0 Platinum Executive Package: + $ 15.75 Total Estimate for Rental: $ 120.75
Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 1 Please enter the number of rental days: 8 Club member?: 1 for yes, 0 for no: 1 Platinum Executive Package?: 1 for yes, 0 for no: 1 Base: 8 days for a Economy @ $35 per day: $ 280 Club Member Discount: – $ 35 Platinum Executive Package: + $ 42 Total Estimate for Rental: $ 287
Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 1 Please enter the number of rental days: ? Club member?: 1 for yes, 0 for no: 1 Platinum Executive Package?: 1 for yes, 0 for no: 0 Base: ? days for a Economy @ $?5 per day: $ ??? Club Member Discount: – $ ?5 Total Estimate for Rental: $ ???
Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 1 Please enter the number of rental days: ? Club member?: 1 for yes, 0 for no: 0 Base: ? days for a Economy @ $?5 per day: $ ??? Total Estimate for Rental: $ ???
Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 2 Please enter the number of rental days: 14 Club member?: 1 for yes, 0 for no: 1 Platinum Executive Package?: 1 for yes, 0 for no: 1 Base: 14 days for a Compact @ $45 per day $ 630 Club Member Discount: – $ 90 Platinum Executive Package: + $ 94.5 Total Estimate for Rental: $ 634.5
Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 3 Please enter the number of rental days: 14 Club member?: 1 for yes, 0 for no: 1 Platinum Executive Package?: 1 for yes, 0 for no: 1 Base: 14 days for a Standard @ $95 per day $ 1330 Club Member Discount: – $ 190 Platinum Executive Package: + $ 199.5 Total Estimate for Rental: $ 1339.5
Available cars: 1 for Economy, 2 for Compact, 3 for Standard Please choose the rental car: 3 Please enter the number of rental days: 7 Club member?: 1 for yes, 0 for no: 1 Platinum Executive Package?: 1 for yes, 0 for no: 0 Base: 7 days for a Standard @ $95 per day $ 665 Club Member Discount: – $ 95 Total Estimate for Rental: $ 570