subject

CODE IN PYTHON: Your task is to write a simple program that would allow a user to compute the cost of a road trip with a car. User will enter the total distance to be traveled in miles along with the miles per gallon (MPG) information of the car he drives and the per gallon cost of gas. Using these 3 pieces of information you can compute the gas cost of the trip.

User will also enter the number of days it will take to complete the trip. For each night (day-1 nights), user will need a hotel. We will ask for the number of stars for the hotel the user wants to stay. 5 star hotel costs $250 per night. 4 star hotel costs $180 per night. 3 star hotel costs $120 per night, 2 star hotel costs $100 per night and finally 1 star hotel costs $50 per night. Using the hotel costs and the number of nights users will need to stay at a hotel, you can compute the hotel cost of the trip.

Please note that 5 star and 4 star hotels give 10% discount if the user will be staying more than 2 nights -- (these are chain hotels, so even if you are staying at different locations discount apply).

We should also account for the cost of meals. This depends on the type of hotel the user is staying. In general, we take 20% of hotel cost as the meal cost (after 10% hotel discount if applicable).

Example Run #1

Distance: 350

MPG : 15

Gas Price: 3.79

Days Traveling : 3

Hotel Stars (1-5) : 3

Your total cost is $376.43333333333334

Example Run #2

Distance: 400

MPG : 20

Gas Price: 2.99

Days Traveling: 1

Hotel Stars (1-5): 5

Your total cost is $59.800000000000004.

Example Run #3

Distance: 150 MPG : 25 Gas Price: 1.99 Days Traveling : 2 Hotel Stars (1-5): 5 Your total cost is $311.94.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 03:30
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
question
Computers and Technology, 24.06.2019 20:00
Individuals suffering from technology overload feel distressed when deprived of computers and mobile devices.true/fasle
Answers: 2
You know the right answer?
CODE IN PYTHON: Your task is to write a simple program that would allow a user to compute the cost...
Questions
Questions on the website: 13722363