A family is planning a road trip and wants to estimate fuel costs, food costs, and see if they qualify for a random travel discount. You will write code to plan their road trip budget.
Sample output:
---------------------------------
ROAD TRIP SUMMARY
β------------------------------
Driver: Maria
Number of Travelers: 4
Gas Needed: 30.18 gallons
Fuel Cost: $108.35
Food Cost: $220.00
Total Cost: $328.35
Average Cost Per Traveler: $82.09
Random Discount: 14%
Discounted Cost: $282.38
Estimated Gas Stops: 8
Miles After Last Stop: 45
Activity1.12.1.
Calculate a road trip budget from the inputs of driver name, total trip miles, vehicle miles per gallon, gas price per gallon, number of travelers, and food budget per person. Calculate the gallons of gas needed, fuel cost, total food cost, total trip cost, average cost per traveler, whole number of gas stops, remaining miles after the last full gas stop, random discount, and discounted total. Display a formatted trip summary like below. Please use the variables provided in the starting code below. Run your code at least once with the following input for autograding:
Sample input: Pat, 200, 30, 4.00, 3, 15
---------------------------------
ROAD TRIP SUMMARY
---------------------------------
Driver: Pat
Number of Travelers: 3
Gas Needed: 6.67 gallons
Fuel Cost: $26.67
Food Cost: $45.00
Total Cost: $71.67
Average Cost Per Traveler: $23.89
Random Discount: 13%
Discounted Cost: $62.35
Estimated Gas Stops: 1
Miles After Last Stop: 80.00
A community center is hosting its annual Community Fun Run and wants a program that automatically creates personalized invitations and printable name badges for participants. The program should personalize the invitation using information entered by the user.
Sample output:
===================================
Community Fun Run Invitation
===================================
Hello Dani Garcia!
You are officially invited to the Community Fun Run
October 12 at 9:00 AM
Riverside Park
Please wear something blue and be prepared
to share your favorite hobby: painting!
Invitation Code: Chpa428
Lucky Prize Number: 57
----------------------------------
NAME BADGE
----------------------------------
COMMUNITY FUN RUN
Name: Dani Garcia
Initials: DG
City: Chicago
Badge ID: DanGar84
----------------------------------
We look forward to seeing you!
Activity1.12.2.
Create a personalized invitation and name badge from the inputs of first name, last name, favorite hobby, favorite color, and city. Create the full name, initials, badge id, invitation code, and lucky number. Display a formatted invitation and name badge like below. Use the variables provided in the starting code below. Run it at least once with the following input for auto-grading:
Input: Dani, Garcia, painting, blue, Chicago
Sample output:
===================================
Community Fun Run Invitation
===================================
Hello Dani Garcia!
You are officially invited to the Community Fun Run
October 12 at 9:00 AM
Riverside Park
Please wear something blue and be prepared
to share your favorite hobby: painting!
Invitation Code: Chpa428
Lucky Prize Number: 57
----------------------------------
NAME BADGE
----------------------------------
COMMUNITY FUN RUN
Name: Dani Garcia
Initials: DG
City: Chicago
Badge ID: DanGar84
----------------------------------
We look forward to seeing you!