Advertisement
Guest User

Untitled

a guest
May 7th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. Objective:
  2. The purpose of this lab project is to expose you to structures and classes.
  3.  
  4. Problem Specification:
  5. Using a structure:
  6. You are to write a program that will define a structure consisting of the following data members, “fields”:
  7. Name - a string
  8. Student id number – an integer.
  9. Three test scores – positive short integers.
  10. Average –a float
  11. Grade – a character.
  12.  
  13. Input to the program consists of:
  14. name
  15. id number
  16. three test scores
  17.  
  18. Requirements:
  19. Use a function to read the name, id number and three test scores, the function will return a structure.
  20. A function to find the average, the function is a void function that takes the entire structure as an argument (by reference) and calculates the average.
  21. A function that takes the average as argument and returns the grade (‘A’,’B’,’C’,’D’, or ’F’) using standard grading.
  22. A function that prints each data member of the structure on a separate line and calls another function that prints the message “You Passed” or “You Failed”.
  23.  
  24. Using a class:
  25. You are to write a program that will define a class consisting of the following data members:
  26. Name - a string
  27. Student id number – an integer.
  28. Three test scores - short integers.
  29.  
  30. Input to the program consists of:
  31. name
  32. id number
  33. three test scores
  34.  
  35. Requirements:
  36. Must use a project with three files (a specification, an implementation, and a client file)
  37. Must define a null destructor, and a constructor with default arguments to initialize data members to null or zero.
  38. Use a setter function to read the name, id number and three test scores from the keyboard.
  39. A getter function that prints each data member of the object on a separate line and uses two private functions that will find the average and grade (local to print) to be printed. Print will also print “You Passed” or “You Failed”.
  40. All getter functions are constant with constant parameters.
  41.  
  42.  
  43.  
  44. Your output, for both, should be a report like follows:
  45. Employee Name : Jim Donavan
  46. Id Number : 2345
  47. Tests :
  48. 1- 78
  49. 2- 88
  50. 3- 98
  51. Average : 88.00
  52. Grade : B You Passed.
  53.  
  54.  
  55. Grading criteria:
  56. Structure implementation
  57. 5 points Good programming practices: Proper spacing, comments, use of descriptive variables, indentation and appearance of program.
  58. 5 points typedef is used to define a structure and the new type is used where needed.
  59. 5 points every function has specifications.
  60. 5 points Hierarchical chart is handed-in and is correct.
  61. 25 points Requirements above are followed.
  62. 5 points test results are handed in.
  63.  
  64. Class Implementation
  65. 5 points project has three files
  66. 3 points Guards are included.
  67. 2 points destructor function is defined as requested.
  68. 5 points constructor functions is defined as requested.
  69. 5 points every function has specifications.
  70. 5 points class diagram including access specifiers is handed-in and is correct.
  71. 20 points Requirements above are followed.
  72. 5 points test results are handed in.
  73.  
  74. Submission Details:
  75.  
  76. Submit a print-out of:
  77. The source files
  78. A hierarchical chart
  79. A class diagram
  80. A test run for each.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement