Advertisement
Guest User

Untitled

a guest
Oct 28th, 2014
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.58 KB | None | 0 0
  1. #! /usr/bin python
  2. #ms.py
  3.  
  4.  
  5. ###################################################
  6. #          Employees information:                 #
  7. #                                                 #
  8. ###################################################
  9.  
  10. def emp_name():
  11.     """displaying employees name"""
  12.    
  13.     first_name = raw_input("Enter first name: ")
  14.     second_name = raw_input("Enter second name: ")
  15.     fs = first_name.capitalize()
  16.     se = second_name.capitalize()
  17.     print "Name: ", fs, " ", se
  18.  
  19.  
  20. def age_lim():
  21.     """displaying age limiti"""
  22.    
  23.     print "This is not the age limit for workere here"
  24.     return
  25.  
  26.  
  27. def emp_age():
  28.     """displaying employees age"""
  29.    
  30.     age = input("Enter age: ")
  31.     age = int(age)
  32.     if age >= 18:
  33.         pass
  34.  
  35.     else:
  36.         return age_lim()
  37.  
  38. def emp_addr():
  39.     """ displayin employees adderess"""
  40.    
  41.     print "Enter employees address\n"
  42.     address = raw_input()
  43.     address = address.upper()
  44.     print "Address: ",  address
  45.  
  46. def emp_payment(h, r):
  47.     pay = int(h) * int(r)
  48.     return pay
  49.  
  50. def emp_advance_salary():
  51.     print "Enter the post paid"
  52.     prepay = raw_input()
  53.     prepay = int(prepay)
  54.    
  55.     # how do i call this function without having to statically input the
  56.     # the argument as so emp_payment(5, 2500)
  57.    
  58.     balance = emp_payment(5, 2500) - prepay
  59.     print "Balance is :", balance
  60.     return balance
  61.  
  62.    
  63. #emp_payment(6, 5000)
  64. #emp_advance_salary()                                        
  65. #emp_data()
  66. #emp_name()
  67.  
  68. class Bar:
  69.     total_cost = 0
  70.     count = 0
  71.  
  72.     def set_name(self, name):
  73.         self.name = name
  74.         return name
  75.  
  76.     def set_price(self, price):
  77.         self.price = price
  78.         return price
  79.  
  80.     def set_count(self):
  81.         counts = Bar.count =+ 1
  82.         print "The number of dinks: ", counts
  83.        
  84. # still have to adjust this section
  85.  
  86.     def set_total_cost(self):                      #I am having some errors #calling this functions
  87.         total = set_price() * set_count()
  88.         print "Total cost of drinks: ", total
  89.         pass
  90.  
  91. bar1 = Bar()
  92. name = bar1.set_name("Beer")
  93. print name
  94. bar2 = Bar()
  95. price = bar2.set_price(500)
  96. print price
  97. bar3 = Bar()
  98. bar3.set_count()
  99. bar4 = Bar()
  100. bar4.set_total_cost()
  101.  
  102.  
  103. class Beer(Bar):
  104.  
  105.     def __init__(self, name, price):
  106.         self.name = name_of_beer
  107.         self.price = price_of_beer
  108.  
  109.     def set_name_of_beer(self):
  110.         return self.name
  111.  
  112.     def set_price_of_beer(self):
  113.         print "price of beer :", self.price
  114.  
  115.     def display_total_cos_of_beer(self):
  116.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement