Question: This lab is about looping through a list of lists to find specific data. A list of lists has been created already which is what

This lab is about looping through a list of lists to find specific data.
A list of lists has been created already which is what you will use.
The goal of this lab is to find if the customer is in the lists and if they are to update their recorded information and if applicable ask if they would like to redeem their free car wash reward.
Each list in the list of lists contains the following information in the corresponding order:
Customers Name
Number of drinks purchased so far
First you should ask for the customers name, using the following prompt: (Note that every prompt in this lab should end with a newline)
Welcome, please input your name:
Once you find a customer, you will ask them how many drinks they bought today and update their drinks purchased info in their list. The prompt for asking for drinks purchased today is as follows:
How many drinks did you purchase today?
Once you have updated the drinks purchased, you will check if they have purchased 15 or more drinks total (today and previously). If the customer has 15 or more drinks then they are eligible for a free car wash and a message stating this should be printed. Otherwise, print how many more drinks the customer must purchase to get the free car wash.
The message for a free car wash is as follows:
Eligible for a free car wash!
If the customer is eligible, ask if they would like to redeem it using the following prompt:
Would you like to redeem your free car wash? (y/n)
And if the customer inputs y then print out the following message using the excess drinks after subtracting 15 from the number of drinks purchased:
After redeeming your free car wash, you have {drinks remaining} drinks remaining towards your next free car wash.
And the message to print with how many more points a customer needs is as follows:
You are {needed drinks} drinks away from a free car wash!
End every session with the following message:
Have a nice day!
Start your output by printing GASWAY REWARDS on one line with the next line containing underscores 15 spaces wide.
Below is an example of how the program should look given the following input:
Input:
Charles Babbage
2
Output:
GASWAY REWARDS
_______________
Welcome, please input your name:
Customer data found...
How many drinks did you purchase today?
Customer Name: Charles Babbage
Number of drinks purchased: 10
You are 5 drinks away from a free car wash!
Have a nice day!
Input:
Grace Hopper
1
y
Output:
GASWAY REWARDS
_______________
Welcome, please input your name:
Customer data found...
How many drinks did you purchase today?
Customer Name: Grace Hopper
Number of drinks purchased: 16
Eligible for a free car wash!
Would you like to redeem your free car wash? (y/n)
After redeeming your free car wash, you have 1 drinks remaining towards your next free car wash.
Have a nice day!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!