A supermarket wants to reward its best customer of each day, showing the customer’s name on a screen in the supermarket. For that purpose, the customer’s purchase amount is stored in a list and the customer’s name is stored in a corresponding list. Implement a function nameOfBestCustomer that returns the name of the customer with the largest sale. def nameOfBestCustomer(sales, customers) Write a program that prompts the cashier to enter all prices and names, adds them to two lists, calls the function that you implemented, and displays the result. Use a price of 0 as a sentinel. Make sure that you use functions in your solution, including a main function.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter1: Getting Started With Excel
Section: Chapter Questions
Problem 4.9CP
icon
Related questions
Question
  •  A supermarket wants to reward its best customer of each day, showing the customer’s name on a screen in the supermarket. For that purpose, the customer’s purchase amount is stored in a list and the customer’s name is stored in a corresponding list.
  • Implement a function nameOfBestCustomer that returns the name of the customer with the largest sale.

def nameOfBestCustomer(sales, customers)

  • Write a program that prompts the cashier to enter all prices and names, adds them to two lists, calls the function that you implemented, and displays the result. Use a price of 0 as a sentinel.
  • Make sure that you use functions in your solution, including a main function.
Enter the amount of sale (0 to end): 12
Enter the name of the customer who paid 12.0: Ahmad Salem
Enter the amount of sale (0 to end): 14
Enter the name of the customer who paid 14.0: Saleem al-Hilali
Enter the amount of sale (0 to end): 20
Enter the name of the customer who paid 20.0: Majid Ahmad
Enter the amount of sale (0 to end): 10
Enter the name of the customer who paid 10.0: Mustafa Salem
Enter the amount of sale (0 to end): 0
The best customer is Majid Ahmad
Transcribed Image Text:Enter the amount of sale (0 to end): 12 Enter the name of the customer who paid 12.0: Ahmad Salem Enter the amount of sale (0 to end): 14 Enter the name of the customer who paid 14.0: Saleem al-Hilali Enter the amount of sale (0 to end): 20 Enter the name of the customer who paid 20.0: Majid Ahmad Enter the amount of sale (0 to end): 10 Enter the name of the customer who paid 10.0: Mustafa Salem Enter the amount of sale (0 to end): 0 The best customer is Majid Ahmad
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning