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
computer - What does tenure track, part time instructor of computer science does...
probability - out of 250 students interviewed at a community college, 90 were ...
computer - Can you explain step by step how data is processed in the computer
Math !!!!!!!! - Ok i have a Summer Math Assignment & i really need help on this...
Computer Science - I need help with this question please! Please write me step ...
Math - 3(-5)squared -2/-5(2)/2 squared I don't get the second part but... any ...
science- anatomy - Situation: You need to step up on a step to reach an object ...
Science (Biology) - What part of the scientific method is this step? The choices...
CSC 111 Intruduction to Computer Science - What does it imply to pursue a ...
English - Let's write down what you can do with the computer. 1. I use the ...