Giter Site home page Giter Site logo

learningclasses's Introduction

Learning about Python Classes

Employee System

Classes:

Employee

  • Must pass in First Name (str), Last Name (str), Salary (int)
  • When printed, outputs all of its information
  • When casted into a string, the salary is used
  • Has a 'Raise Amount' of 5%
  • Can be added to the employee's salary by using the .apply_raise() method
    • Can be directly modified by assigning an integer value to the class variable
    • Ex: x.raiseAmt = 2 <--Directly modifies the class variable, applying it to all instances

Manager

  • Must pass in First Name (str), Last Name (str), Salary (int), and the employees under their management (list)
  • When printed, outputs all of its information
  • When casted into a string, the salary is used
  • Has a 'Raise Amount' of 10%
    • Can be added to the employee's salary by using the .apply_raise() method
  • Employees under the manager's management can be added
    • Use the .add_employee() method
  • Employees under the manager's management can be removed
    • Use the .remove_employee() method
  • Check if it is a workday by using the is_workday(int) method
    • Day of the week as an integer must be passed in where 1 = Monday and 7 = Sunday

learningclasses's People

Contributors

graysonhuey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.