CIS 162 AD - C# Programming I - Section 5832
Worksheet #2
Due Thursday, February 9, 2006

Name:

I. Definitions: please explain the following terms:

  1. software

  2. literal

  3. object

  4. algorithm

  5. string

  6. assignment statement

  7. preincrement operator

  8. const

  9. operator precedence

  10. casting

II. Questions or short essay

  1. What are differences between syntax errors, logic errors, and runtime errors?

  2. Why does C# require that you declare variables?

  3. Why is it necessary to include a Main() method in your program?

  4. What does the compound operator += do?

  5. What is the difference between the data types int and double?

  6. How do you output a value to print in currency format?
III. Programming Exercises Write source code for the following:

    Write a program that calculates and prints the take-home pay for a commissioned sales employee. Initialize and store the name of employee Jessica Oakley in a variable called employeeName. Jessica received 7% of her total sales. Her federal tax rate is 18%. She contributes 10% to a retirement program and 6% to Social Security. Input the sales for the week. Produce a formatted report showing the amount for each of the computed items. Select appropriate constants to use in the calculations.