put("Enter employee name: ")         data.emp_pos = input("Enter employee position: ")         data.emp_year_hired = int(input("Enter the year hired: "))         data.emp_sal = float(input("Enter Emplo

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

can someone make this code a flowchart?

import pyfiglet

class employee:
    # ASCII ART USING PYFIGLET
    header = pyfiglet.figlet_format("EMPLOYEE INFORMATION", font = "cybermedium" )
    print(header)
  
    #data
    def data_entry(data):
        data.emp_no = input("Enter employee number: ")
        data.emp_name = input("Enter employee name: ")
        data.emp_pos = input("Enter employee position: ")
        data.emp_year_hired = int(input("Enter the year hired: "))
        data.emp_sal = float(input("Enter Employee Rate(per hour): "))
        data.emp_serv = 2022 - data.emp_year_hired
        print("*"*36)
  
    #determine the status of the employee by the number of years they served.
    def sal_entry(data):
        if(data.emp_serv < 2):
            data.emp_stat = 'Contractual'
            bon_per = 10
            rph = data.emp_sal
        elif((data.emp_serv >=2) and (data.emp_serv < 4)):
            data.emp_stat = 'Probationary'
            bon_per = 20
            rph = data.emp_sal
        elif((data.emp_serv >=4) and (data.emp_serv < 11)):
            data.emp_stat = 'Tenured'
            bon_per = 50
            rph = data.emp_sal
        elif((data.emp_serv >=11)):
            data.emp_stat = 'Tenured'
            bon_per = 75
            rph = data.emp_sal
        else:
            result = pyfiglet.figlet_format("ERROR", font = "cybermedium" )
            print(result)
    # gross and annual salary calculation
        data.gross_sal = 160 * rph
        data.annual_sal = data.gross_sal * 12
    # yearend bonus calculation
        data.year_end_bonus = data.annual_sal * (bon_per/100)

    #PAYSLIP 
    def payslip(data):
        print("\n\n")
        slip = pyfiglet.figlet_format("EMPLOYEE PAYSLIP", font = "cybermedium" )#ASCII ART USING PYFIGLET
        print(slip)
        print("NAME :\t\t\t", data.emp_name)
        print("EMPLOYEE NUMBER :\t", data.emp_no)
        print("POSITION :\t\t", data.emp_pos)
        print("EMPLOYEE STATUS :\t", data.emp_stat)
        print("YEAR HIRED :\t\t", data.emp_year_hired)
        print("YEARS OF SERVICE :\t", data.emp_serv)
        print("GROSS SALARY :\t\t", format (data.gross_sal, ".2f"))
        print("ANNUAL SALARY :\t\t", format (data.annual_sal, ".2f"))
        print("YEAR END BONUS :\t", format (data.year_end_bonus, ".2f"))
        print("\n")
        print("*"*36)

  
e = employee() 
e.data_entry() 
e.sal_entry() 
e.payslip() 

Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Dictionary
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education