You are on page 1of 13

FINAL ASSESSMENT TEST

Machine Problem in CS002L

FAUSTO, REYNA RHIZA D.


DE VILLA, MARC DANIEL

I. Project Name: Employees’ Information

Problem Definition: Create and design a program that will accept employee’s
information such as employee number, employee name, employee status (T-
Tenured / P-Probitionary / C-Contractual), employee position title, basic
salary, year end bonus and year hired.

Program Specifications:
1. Create and design a Menu Option for Employee Information with an
ASCII Art.
2. A Python class/object concept must be apply to perform the following
individual method:
 Data Entry. Create the Python Methods to accept employee’s
information.
 Salary Entry. Designed a screen message to accept employee’s
salary.
o Gross salary = hours worked multiply (160 hrs) by rate per
hour
o Year End Bonus = Annual Salary * Bonus % (see table below)
o Annual Salary = Gross salary multiply by 12 months
 Display Information. Designed the employee’s information pay slip.

CS002L 2nd TERM.2021.2022.ASDS


3. Consider the following criteria of employees’ salary:

Years of
Employee (rate per Employee
Service Year Bonus hour) Status

10% of Annual
1 500.00 to 950.00 C
Salary

20% of Annual
2 to 3 1000.00 to 1500.00 P
Salary

50% of Annual
4 to 10 1950.00 to 2500.00 T
Salary

75% of Annual
11 & above 3000.00 to 5000.00 T
Salary

4. Apply the three basic control structure statement according to Python


Framework.
5. Addition to the Python structure, you may apply the use of Python
Functions or Python Module.
6. Design an output that is similar to a Payslip Form for output validation.
7. Kindy generate three final output based on the employees’ status.

CS002L 2nd TERM.2021.2022.ASDS


II. PROJECT NAME : E-STORE INFORMATION

Problem Definition:
 Create and design a Python program that will determine a product,
price, quantity, total amount etc. (i.e. Menu Options)
 Demonstrate the concept of Python Program using Sequential,
Selection and Loop Control Statement.
 Addition to the Python structure, you may apply the use of Python
Function/Method or Python Module.
 Construct the Flowchart to show the program logic sequence.
 FINAL OUTPUT >>> At least 3 to 4 sample transaction.
 Herewith are the requirements:
i. Store Name
ii. Name of Customer
iii. Address
iv. Contact Number
v. List of Product to offer
vi. Price List
vii. Cash Amount
viii. Total Quantity of Product
ix. Total Amount to be paid.
x. Changed

CS002L 2nd TERM.2021.2022.ASDS


xi. ASCII ART for your Product
xii. Sample Output

PLEASE BE GUIDED.
GUIDELINES:
a. Use the official inbox bin during the submission of the MACHINE PROBLEM.
b. However, if there will be unwanted scenario like health and technical issues,
the student must report at once before the deadline of the final project, send a
letter through the respective MS Teams or Email Outlook with parents or
guardian signature .
c. Herewith is the deadline of the Machine Problem: on or before March
5, 2022 until 11:55 PM.
d. Moreover, the main reason for no. 2, if the student failed to comply with the
deadline before the Final Viewing of the 2nd Term Grade on March 10, 2022.
The student and I must agree on the result of his or her grade which is
equivalent to INC or Incomplete.
e. Please do not overlap your solution in one page, make it organize and avoid
ambiguous code.
f. DEMERIT OF 5 POINT FOR LATE SUBMISSION.
g. NO ACCEPTANCE OF FINAL COURSE REQUIREMENT LATER THAN
MARCH 5.2022. FOR STRICT COMPLIANCE.

II. Consider the grade score for this OBE activity.

Score = 100 pts.


Input >>> 40% = 40 pts.
Process >>> 40% = 40 pts.
Output >>> 20% = 20 pts

CS002L 2nd TERM.2021.2022.ASDS


a. Exceptional Task – 100%
 Complete program specification or beyond the required specs.
 Show a sample validation of display output
 Complete Control Structure Statements
 Proper exit of the program.
 Submitted on or before the given deadline
 No glitches/No irregularity in program logic
b. Very Satisfactory Task
 90% of complete program specification
 Show a sample validation of display output
 Complete Control Structure Statements
 Proper exit of the program.
 Submitted on or before the given deadline
 No glitches/No irregularity in program logic
c. Average Task
 70% of complete program specification
 Show a sample validation of display output
 Complete Control Structure Statements
 Submitted on or before the given deadline
 Proper exit of the program.
 No glitches/No irregularity in program logic
d. NO FINAL OBE PROJECT = ZERO

CS002L 2nd TERM.2021.2022.ASDS


#START YOUR SOLUTION HERE!

#FLOWCHART

Start ,Menu , data input , salary input, payslip display, end

#PYTHON CODE

current_year = 2022

class Employee:

# constructor

def __init__(self) -> None:

self.employee_no = 0

self.name = ""

self.status = ""

self.position = ""

self.basic_salary = 0

self.year_end_bonus = 0

self.year_hired = 0

# function to get employee date from user

def get_data(self):

print("------------------SHELBY COMPANY LTD.--------------------")

print("xx-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-xx")

self.employee_no = int(input("Enter Employee Number: "))

self.name = input("Enter Employee Fullname: ")

CS002L 2nd TERM.2021.2022.ASDS


self.status = input("Enter Employee Status(C/P/T): ")

self.position = input("Enter Employee Position Title: ")

self.year_hired = int(input("Enter Year Hired: "))

print("xx-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-xx")

# function to calculate gross salary based on employee information

# and criteria as given in question

def calculate_gross_salary(self):

years_of_service = current_year - self.year_hired

# rate per hour case 1

if self.status == "C" and years_of_service == 1:

rate_per_hour = float(input("Please enter the rate per hour(500-950): "))

while rate_per_hour not in range(500, 951):

print("Invalid rate per hour")

rate_per_hour = float(input("Please enter the rate per hour(500-950): "))

# rate per hour case 2

elif self.status == "P" and years_of_service in range(2,3):

rate_per_hour = float(input("Please enter the rate per hour(1000-1500): "))

while rate_per_hour not in range(1000, 1501):

print("Invalid rate per hour")

rate_per_hour = float(input("Please enter the rate per hour(1000-1500): "))

# rate per hour case 3

elif self.status == "T" and years_of_service in range(4,10):

rate_per_hour = float(input("Please enter the rate per hour(1950-2500): "))

CS002L 2nd TERM.2021.2022.ASDS


while rate_per_hour not in range(1950,2500):

print("Invalid rate per hour")

rate_per_hour = float(input("Please enter the rate per hour(1950-2500): "))

# rate per hour case 4

elif self.status == "T" and years_of_service > 11:

rate_per_hour = float(input("Please enter the rate per hour(3000-5000): "))

while rate_per_hour not in range(3000,5000):

print("Invalid rate per hour")

rate_per_hour = float(input("Please enter the rate per hour(3000-5000): "))

# calculate the basic salary

self.basic_salary = rate_per_hour * 160

# function to calculate the annual salary

def calculate_annual_salary(self):

self.calculate_gross_salary()

return self.basic_salary * 12

# function to calculate the year end bonus

# according to criteria as given in question

def calculate_year_end_bonus(self):

years_of_service = current_year - self.year_hired

# case 1

CS002L 2nd TERM.2021.2022.ASDS


if self.status == "C" and years_of_service == 1:

bonus = .1

# case 2

elif self.status == "P" and years_of_service in range(2,4):

bonus = .2

# case 3

elif self.status == "T" and years_of_service in range(4,10):

bonus = .5

# case 4

elif self.status == "T" and years_of_service > 11:

bonus = .75

# calculate year end bonus

self.year_end_bonus = self.calculate_annual_salary() * bonus

# function to display employee data

def display(self):

print("**********************************************")

self.calculate_year_end_bonus()

print("PAY SLIP")

print("###############################################")

print("Employee number:", self.employee_no)

print("Employee name:", self.name)

print("Employee status:", self.status)

print("Employee position:", self.position)

CS002L 2nd TERM.2021.2022.ASDS


print("Employee year hired:", self.year_hired)

print("Employee basic salary annually:", self.basic_salary)

print("Employee year end bonus:", self.year_end_bonus)

print("###############################################")

print("***********************************************")

# create employee object

emp = Employee()

# get data from user

emp.get_data()

# show the employee data

emp.display()

#SCREENSHOT OF PYTHON CODE FROM PYTHON EDITOR

CS002L 2nd TERM.2021.2022.ASDS


CS002L 2nd TERM.2021.2022.ASDS
CS002L 2nd TERM.2021.2022.ASDS
#SCREENSHOT OF SAMPLE OUTPUT FROM PYTHON SHELL

#MAXIMUM OF FOUR (4) SAMPLE OF OUTPUT

CS002L 2nd TERM.2021.2022.ASDS

You might also like