Description
Introduction
In this assignment you have to understand and implement the following concepts
• Variables
• IF-ELSE conditioning
Objectives
• To develop skills for using if – else statements.
• To understand how to program conditional calculations.
Tools/Software Requirement
• Microsoft Visual Studio 2010 or later
Task 1
Problem Statement:
In this assignment you will create a program that an employee can use to calculate his/her
pension. The pension is calculated by applying some calculations on his last drawn salary.
Details about salary:
Employee’s salary is divided into three parts. One part is the basic salary, the second part is the
house rent and the third part is the old age allowance. These three combine to form an
employee’s total salary.
5% income tax and 7% provincial tax is deducted from the basic pay.
The house rent and old age allowance are calculated after the deduction of tax.
Employee, who is less than 45 years of age, gets no old age allowance.
For an employee who is between 45 and 55, old age allowance is 10%.
For employees older than 55 the old age allowance is 15%
CS110: Fundamentals of Computer Programming Page 3
Married employees are not given any house rent and the married get 15%.
Pension calculation:
An employee’s pension is calculated according to the following rules:
1. Basic pay is doubled and multiplied with the number of months is service.
2. House rent is multiplied with the months in service since marriage.
3. Old age allowance is multiplied with 3.
4. Total pay is multiplied with 2.
5. The total of the above four are added together to compute the pension.
Take necessary input from a user and calculate her/his pension. You cannot ask the employee
about the months in service, or the months in service since marriage. Employee’s input should be
a date and you need to calculate the months in your program.
The output of the program must be very structured and detailed. It not only shows the pension
but also must show all the calculations under proper heads and step-by-step so the employee can
understand how the pension is computed.
Task 2
Problem Statement:
In this part of the assignment you learn to use math.h and then you will create a console-based
calculator.
Details
Create a calculator that works on the console. User can enter the operands and an operator and
gets the result back on the console. You can use math.h for scientific computations. For full
credit, you should also include a Boolean calculator.
For highest marks you should include as many features in your calculator as you can.
At the start of your program you should output all the operators that you have implemented and
also the instructions for using your calculator. Your software should be complete in all aspects to
be used by a non-technical user.
CS110: Fundamentals of Computer Programming Page 4
General Instructions
Any assumptions that you take must be properly stated.
You must do this work individually but you can ask for help from the Lab Engineer. You cannot
share your code with anyone or copy code. Plagiarism will result in zero marks.
Deliverables
Submit only 1 zip file on the given LMS link which contains both the programs. You must
include the source code files, not an exe or any other kind of file. Your file should be named as
asg1[YOUR FIRST AND LAST NAME].zip
Always submit 1 day before the deadline to avoid any last minute delays.
Marks break down:
1. Working of the program: 50%
2. Code readability: 25%
3. Output structure and aesthetics: 25%