Advertisement
Guest User

ass1

a guest
Sep 10th, 2012
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. This assignment requires you to develop and submit a program to demonstrate that you understand the programming concepts presented from week 1 to week 8. The focus of this program is mainly on the use of arrays to store data about multiple entries, and the user of methods to modularize code.
  2. Create a new C# console application project in Visual Studio and name the project ass1.
  3.  
  4. Program description:
  5. Develop a program that collects information about a maximum of 50 persons including their salary. Provide functions to Add, Search, Display and Delete a person and enable the user to calculate and display a person’s tax and pay rate according to the salary entered and calculate and display the gross, net pay and tax deduction as per the example.
  6. The program should contain the following functionality:
  7. Store a maximum of 50 person records containing the following: Full Name Street Number Address State Post Code Phone number Salary
  8.  
  9. Add a person record :
  10. Prompt for the person data and store the data entered into the next array position.
  11. Validate the following fields to ensure they are correct before storing the data: Post Code must be numeric and 4 digits Phone number must be numeric and a maximum of 10 digits Salary is a valid numeric value
  12.  
  13. Find a person record :
  14. Prompt for the Full Name of the person to search. The user may enter part or all of the name. Search through all the Full Names until a match is found and return the index of the person found. Display the person record found.
  15.  
  16. Delete a person :
  17. Delete the current active person Ensure you display the person, then ask the user to confirm they want to delete the person before deleting. It is up to you how you undertake the deleting in the array.
  18. Display the current person
  19.  
  20. Output the person details a follows:
  21. Persons Details : Jason Wells 25 Big Rd, Vic, 3220 52227009
  22. Annual Salary : $45,567
  23. Calculate and display a pay slip :
  24. Display current active person
  25. Prompt for hours worked
  26. Calculate the current active persons pay using the following: Gross pay is Hours worked * Pay rate Tax is calculated by applying the Tax rate to the Gross pay The Net pay is the Gross pay minus the amount of Tax
  27.  
  28. Output the results a follows:
  29. SIT102 Introduction to Programming – MIBT Trimester 2 2012 16
  30. Persons Details : Jason Wells 25 Big Rd, Vic, 3220 52227009
  31. Annual Salary : $45,567
  32. Hours worked : 16.5 hours Pay Rate : $31.31 Tax Rate : 35.72% Gross Pay : $516.62 Tax : $161.75 Net Pay : $354.87
  33.  
  34. Requirements:
  35. You may use the solution provided for practical test 5 or your code to enhance and change the program to suit the assignment 1 specifications.
  36. You must use arrays to store the person data. You must declare the arrays within the Main and pass the arrays to the methods.
  37. You must use functions in your code. Functions could include: AddPerson FindPerson DeletePerson DisplayPerson CalaculateDisplayPay GetTaxRate GetPayRate
  38. Other functions may be created as required.
  39. Data must be passed to the functions.
  40. Use a menu to control the program: Add a person (a) Find a person (s) Display current person (p) Delete current person (d) Calculate and display pay slip for current person (c) Exit (x)
  41. Display the menu and wait for the users response.
  42. SIT102 Introduction to Programming – MIBT Trimester 2 2012 17
  43. Process the options entered until the user enters 'x' to quit.
  44. Use a switch statement organise the code to suit the option selected.
  45. Your program should display appropriate informative prompts, retrieve the data from the keyboard and check the data is valid then store each entry.
  46. Note : Where an error is detected in the data entry process, display an appropriate message then re prompt the user to enter the data again.
  47. Number> is replaced with your student number. For example, sit102-Ass1- WKSAL12.zip Submit the file via the assignment submission link in Moodle.
  48. SIT102
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement