Application
WAGES CALCULATOR
The American University of Afghanistan
Prepared by: Noor Mohammad Sheikh
ID # 4972
Contents
Introduction .................................................................................................................................................. 3
Part 1 ............................................................................................................................................................. 4
Generate a Pseudo Code for Part 1 .......................................................................................................... 4
Generate Flow Chart for Part 1 ................................................................................................................. 5
Generate the Code for Part 1.................................................................................................................... 6
Result of Part 1.......................................................................................................................................... 7
Part 2 ............................................................................................................................................................. 8
Background Information ........................................................................................................................... 8
Code for Part 2 .......................................................................................................................................... 8
Result of Part 2.......................................................................................................................................... 9
Total Source Code for Wages Calculator .................................................................................................... 10
Result of Wages Calculator ......................................................................................................................... 12
Conclusion ................................................................................................................................................... 12
Page |3
Introduction
This is a Programming I (Java: How to program) class assignment. The duration of this assignment is one week started from 14th November, 2012 and the due date is 21th November,
2012. We should submit the soft copy by email on 20 th November, 2012 before 9:00 PM and the hard copy on 21th November, 2012.
In this assignment we should have to create an application in Java programming language which will calculate the wages of employee of a company. There are two parts of this application. The first part is that, the company has two different kind of payment systems one is based on 40 hours which will have normal hourly salary rate, and other is overtime hours which will be paid with rate with one half of the rate. We should create an application in which the company should enter the hours an employee worked and hourly rate and the application will generate the total salary.
In the second part, we will deduct some important payments from the total of per user.
We should deduct local tax, some payment for investment purposes, medical tax and national tax. Page |4
Part 1
Generate a Pseudo Code for Part 1
Set hours to zero;
Set rate to zero;
Set total to zero;
Set localTax to zero;
Set investmentPurpose to zero;
Set medicalTax to zero;
Set nationalTax to zero;
Prompt the user to exter the hours;
Input the hours;
While hours not equal to -1
Prompt user to input the rate
Input the rate
If hours less than or equal to 40
Multiply hours with rate and then add to total
Else if hours are greater than 40
Multiply hours with 40 and add with hours minus 40 and multiply with (rate *
1.5) and add to total
Print the total
For repetition of code
Prompt the user to exter the hours;
Input the hours; so the above two statements will repeat