# Practice Exercises

  • Account – Add one more point of validation to the Account class: Do not allow depositing or withdrawing non-positive amounts.
  • Rectangle – The height and width of the rectangle must be greater than zero.
  • Cone – The radius and height of the cone must be greater than zero.
  • Course – The course name and number cannot be blank, and the exam and lab counts must be greater than zero. The class hours must also be greater than zero.
  • Cylinder – The radius and height of the cylinder must be greater than zero.
  • HazardousMaterial – The class code for the hazardous material can only be the letters 'A' through 'F', inclusive.
  • ExamResult - Requires a positive, non-zero value for the total marks and weight. The weight cannot be over 50. The marks earned can be between zero and the total marks, inclusive. The student ID must be 9 digits, and the exam name cannot be an empty string.
  • LabResult – Requires a positive, non-zero value for the lab number, total marks and weight. The weight cannot be over 50. The marks earned can be between zero and the total marks, inclusive. The student ID must be 9 digits.
  • PeopleCounter – Does not allow adding a negative number of people to the counter.
  • BulkItem – The description cannot be blank and the cost and quantity values must be greater than zero.
Last updated on: 9/21/2019, 11:09:56 PM