You are on page 1of 4

CS10-8L: Computer Programming Laboratory

Machine Problem #5: Monthly Salary Calculation

Name: Jian Karlo R. Sta. Maria Score:

Section: A14 Date: 3/25/21

OBJECTIVES
● To familiarize the students with the MATLAB interface.
● To enable the students to use Control Structure Selection.

Instructions:
1. Save your file as Surname_Firstname_MP5. Ex. Santos_Jared_MP5

2. You will submit a zip file containing the following and send it to BB.

a. PDF file of Machine Problem 5 provided with the screenshot of your answers.
b. MATLAB script with .m extension.

3. Your program must have comments for each section.


Header Comments:
%{
This demo program shows how good a MATLAB program is
Written by: Ana Sy
Date: August 27,2020
Time: 2:20pm
Program: BSIE
Course: CS10-8L
Section: B20
School: Mapua University
%}

MACHINE PROBLEM

1. The monthly salary of a sales agent is computed based on his status and his monthly sales. A Regular
Status has 80 sales quota, while Probationary and Trainee has 60 and 40 respectively. Commission is 250
pesos per sales and bonus is 400 per sales exceeding quota. Accomplishment percentage is the actual sales
versus the quota, and there is a 50 pesos penalty deduction for every missed %. The company deducts a flat
500 pesos tax.

Status Quota
A – Regular 80 Sales
B – Probationary 60 Sales
C – Trainee 40 Sales

Commission is 250 per sales.


Bonus is 400 per sales exceeding quota

Formula: Commission + Bonus – Penalty – Tax

1st Sample Program Run

Enter Agent Status (A Regular, B Prob, C Trainee): A

Prepared by: Christian Maldonado, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #5: Monthly Salary Calculation

Enter your Actual Sales: 83

Your Salary is 20,700.00

Breakdown:
Commission
80 x 250 = 20,000.00

Bonus
3 x 400 = 1,200.00

Penalty = 0

Tax = 500

2nd Sample Program Run

Enter Agent Status (A Regular, B Prob, C Trainee): C


Enter your Actual Sales: 37

Your Salary is 8,375.00

Breakdown:
Commission
37 x 250 = 9,250.00

Bonus
0 x 400 = 0

Penalty = 375
37/40 = 92.5%
100% - 92.5% = 7.5% penalty
7.5 x 50 = 375

Tax = 500

Prepared by: Christian Maldonado, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #5: Monthly Salary Calculation

In the editor window, take a screenshot and paste your output:

Prepared by: Christian Maldonado, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #5: Monthly Salary Calculation

In the command window, take a screenshot and paste your output:

Prepared by: Christian Maldonado, Mapua University

You might also like