You are on page 1of 4

CS111

Assignment 1
2023
Semester 1

Name: Ritesh Kumar Ram


ID Number: S11149101
Campus: Laucala Campus
Section 2
Exercise 1
1. Start procedure
2. Input First Name
- Input Surname
- Input Employee ID
- Input Gender (Male or Female)
- Input Year of Birth
- Input number of hours worked in a week
3. Calculate the annual income and the income tax due on the annual income:
- If Age < 55 (male)
0% tax if annual income < 10 000,
Else
10% tax if 10 000 ≤ annual income ≤ 30 000
Else
20% tax if 30 000 < annual income ≤ 100 000
Else
30% tax if annual income > 100 000
- If Age < 55 (female)
0% tax if annual income < 12 000,
Else
10% tax if 12 000 ≤ annual income ≤ 35 000
Else
20% tax if 35 000 < annual income ≤ 100 000
Else
30% tax if annual income > 100 000

4. If age 55 ≤ Age < 80


Male and Female:
0% tax if annual income < 50 000,
Else
10% tax if 50 000 ≤ annual income ≤ 70 000
Else
20% tax if 70 000 < annual income ≤ 150 000
Else
30% tax if annual income > 150 000

5. If Age > = 80
Male and Female:
0% tax on all income (No Tax)

6. Display output
- Name
- Employee ID
- Age
- Gross Pay Week
- Annual, Salary
- Tax Amount

7. End Procedure

Exercise 2
1.
- Age
- Number of hours worked
- Year of birth
2.
- Age
- Number of hours worked
- Year of birth

3. Age – numeric
Number of hours worked – numeric
Year of birth – categories

Age is used as numeric since it id declared only in number likewise for hours worked.
Since year of birth goes according by years, it is declared as categories.

4. Do Loop is best to validate the inputs


The condition is that it validates data input by the user, and repeat the request for the data
in the case where the input of the user is not valid.

Exercise 3
ON ERROR
CHECK EXCEPTION
CHECK PROPERTY
The program which I developed actually does not produce the correct result as expected but the
interface, input data and output result is calculated.
Exercise 4
This would not be morally acceptable in my opinion because basic programming ethics indicate
that a programmer should never produce or disseminate malware or inaccuracy and should never
purposefully obfuscate or make difficult to understand code.
Since this assignment is based just for students learning and development in coding skills, it is
fairly acceptable ensuring it does not report any illegal activities by any end user such as any
employee or employer.

You might also like