CIS 162 AD - C# Programming I - Section 5832
Worksheet #2
Due Thursday, February 9, 2006
Name:
I. Definitions: please explain the following terms:
- software
- literal
- object
- algorithm
- string
- assignment statement
- preincrement operator
- const
- operator precedence
- casting
II. Questions or short essay
- What are differences between syntax errors, logic errors, and runtime errors?
- Why does C# require that you declare variables?
- Why is it necessary to include a Main() method in your program?
- What does the compound operator += do?
- What is the difference between the data types int and double?
- 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.