Posted by jose coco on Sunday, July 3, 2011 at 8:19pm.
Step 3: Part C
iLab Part C: Payroll Program
Step 1: Create a New Project
Create a new project and name it LAB1C. Make sure you close your previous program by clicking File >> Close Solution.
This time, do not delete the code that gets automatically created. Instead, insert your code right between the curly braces, as illustrated below.
static void Main(string  Args)
// your code goes here!
Include a comment box like what you coded in Part B. This can go at the very top of your program.
You will write a program that calculates and displays the take-home pay for a commissioned sales employee along with all of the deductions based on the Processing Logic provided in Step 2.
Step 2: Processing Logic
Input: Prompt the user for the weekly sales
Process: Perform the calculations. The employee receives 7% of her total sales as her gross pay. Her federal tax rate is 18%. She contributes 10% to her retirement program and 6% to Social Security.
Output: Display the results
Sample Output from Lab 1:
Enter Weekly Sales: 28000
Total Sales: $28,000.00
Gross pay (7%): $1,960.00
Federal tax paid: $352.80
Social security paid: $117.60
Retirement contribution: $196.00
Total deductions: $666.40
Take home pay: $1,293.60
Press any key to continue . . .
1. Declare variables
2. Accept Input – weeklySales
3. Calculate Gross Pay = Weekly Sales * .07
4. Calculate Federal Tax = Gross Pay * .18
5. Calculate Social Security = Gross Pay * .06
6. Calculate Retirement = Gross Pay * .1
7. Calculate Total Deductions = Federal Tax + Social Security + Retirement
8. Calculate Total Take Home Pay = Gross Pay – Total Deductions
9. Display the following on separate lines and format variables with $ and decimal
a. Total Sales Amount: value of weekly sales
b. Gross Pay (.07): value of gross pay
c. Federal Tax paid (.18): value of federal tax
d. Social Security paid (.06): value of social security
e. Retirement contribution (.1): value of retirement
f. Total Deductions: value of total deductions
g. Take Home Pay: value of take home pay
Step 3: Save program
Save your program by clicking File on the menu bar and then clicking Save Program.cs, or by clicking the Save button on the toolbar, or Ctrl + S.
Step 4: Build Solution
To compile the program, click Build on the menu bar and then click the Build Solution or Build LabC option. You should receive no error messages. If you see some error messages, check the code above to make sure you didn’t key in something wrong. Once you make your corrections to the code, go ahead and click Build >> Build Solution again.
Step 5: Execute the program
Once you have no syntax errors, to execute or run your program, click Debug on the menu bar, and then click Start Without Debugging.
Step 6: Capture the output
1. Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document].
2. Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3. Save the Word Document as CIS170A_Lab01_C_LastName_FirstInitial
End of PART C
END OF LAB
Answer this Question
Programming - Write a program to do the following: In main, declare a Player ...
offfice finaces - Using your computer software, you create a new file for an ...
VB - I am new here; say to everyone first. Here is the a question for coding ...
bookkeeping - Using your computer, you create a file for an existing costumer. ...
computer - Create a new project Lab05e, and write a program that asks the user ...
Computer - After writing the program of Exercise 17.7, write a simple program to...
computer science - How can i create my computer science project which is to draw...
UOP - The final project for HSM 240 is a 1,750- to 2,100-word proposal paper on ...
Computer science - As a member of the Information Security team at a small ...
At-Risk children - Create a plan for identifying potential students for the new ...