1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Fed [463]
3 years ago
8

A friend a just opened his own barber shop and has asked you to develop a program to track the type of service the customer is r

eceiving and the cost for the service and also include any tips the customer may give to the barber. The name of your friend's barber shop is Big Al's and on each customer receipt he wants to display the name of his shop, customer name, the type of service, cost of the service, and the amount of the tip for a total price of the service rendered. Name your variables Declare your variables
Computers and Technology
1 answer:
True [87]3 years ago
4 0

Answer:

class Barber(object):

   barber_shop = "Big AI's barber shop"

   def __init__(self, customer_name, type_of_service=[], tip=0):

       self.cust_name = customer_name

       self.tos = type_of_service

       self.tip = tip

   def service_type(self, *args):

       for i in args:

           self.tos.append(i)

   def total(self):

       

       services = {'trimming':10, 'hair_cut':20, 'shaving':15, 'washing':5, 'dyeing':5}

       contain = ''

       total = 0

       for service in self.tos:

           if service in services.keys():

               total += services[service]

               contain += f'{service}: {services[service]}\n'

       

       print(self.barber_shop,'\n', self.cust_name,'\n', 'Services:',contain.splitlines(),'\n', \

           f'total: ${total}', '\n',f'Tip: ${self.tip}')

mycust = Barber('John',['washing'],6 )

mycust.service_type('shaving', 'dyeing')

mycust.total()

Explanation:

The Barber class is a blueprint used to create an object instance of customers that visits the barber-shop. It has two methods 'service_type' and 'total' which are just defined functions of the class that appends services to the type of service variable and total that prints the total cost of services on the screen.

You might be interested in
Complexities of communication are organized into successive layers of protocols: lower-level layers are more specific to medium,
Galina-37 [17]

Answer:

Transport layer

establishes, maintains and terminates network connections

Network layer

ensures the reliability of link

Data link layer

provides functions to guarantee reliable network link

Physical layer

controls transmission of the raw bit stream over the medium

Explanation:

see Answer

4 0
4 years ago
Why the car floated before it started to sink? Explain.​
zhenek [66]

Answer:

it still had air in it

Explanation:

its simple

8 0
3 years ago
What is the function of a text box in Microsoft word?​
Lisa [10]
A text box is an object you can add to your document that lets you put and type text anywhere in your file. Text boxes can be useful for drawing attention to specific text and can also be helpful when you need to move text around in your document.
4 0
3 years ago
In Adobe illustrator cc 2017 which of the following export file ​
eduard

Explanation:

In Adobe illustrator cc (2017) , of the following export file formats cannot preserve transparency

8 0
3 years ago
4. What is the difference between portrait orientation and landscape orientation? (1.0 points)
Bezzdna [24]

Answer:

Portrait orientation is taller then it is wide, while landscape orientation is wider then it is tall.

Explanation:

3 0
4 years ago
Other questions:
  • Why do bullies and criminals often say things online they otherwise wouldn’t say
    9·2 answers
  • Select all that apply. Given the following code fragment, which of the things shown below happen when the statement on line 8 ex
    13·1 answer
  • For C programming language, what does it mean when you have an exclamation mark after an equal sign? ie:
    5·1 answer
  • Read the sentence.
    10·1 answer
  • Which of the following would be an appropriate use of a check box control?
    15·1 answer
  • The frequency of a sine wave is defined as:
    8·1 answer
  • Hosts A and B are 20 000 km away from each other. The propagation speed of the link between them is 25000 mps. The data is place
    9·1 answer
  • Plz help need answers!???idk if u can zoom
    13·1 answer
  • What is the function of the following shape? display result to user get input from user make a decision process information
    7·1 answer
  • Plsss help me plsssssss
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!