CS 222 Spring 2016

Course Query System, Part II

Due: First commit: May 05 23:55 pm, Second commit: May 09, 23:55 pm.

Language: Java

Submission:

  • DO NOT include package names
  • Check your file encoding. It should be UTF-8
  • Commit your code to SVN

Context: You are given the courses offered for one semester in CodeHero Academy. Your task is to extendthe software you have written. The new requirements are:

  1. Adding a new course to the system. This new functionality has nothing to do with JSON data. Extend your menu simply to add a new course. The user should be prompted to enter all attributes of a course.
  2. Adding a Student to the system. Its attributes are:
    • Student full name
    • Student ID
    • Courses that the student takes
    • Weekly course plan of the student
  3. Extending the menu to create students. Also add necessary functionality to your menu for a student to:
    • Add courses taken
    • See weekly course plan
  4. Add necessary functinality so that when courses are listed or queried, the user should see which students (show only student IDs) take that course.

Task 1 - TDD

Think about how to write the Student class. Write test cases for this class and add it to your source folder with the name StudentTest.java. After writing your test cases, please commit to SVN (before first commit deadline). If you don’t commit the TDD part individually you will not get any points for it. You can start working on Task 2-4 before the first commit deadline of course, but DO NO COMMIT your files that are not related to Task 1 before the first deadline.

Task 2 - Object Formation

Write your code for the Student class meeting the requirements stated above and commit to SVN again. A student must have the information of courses taken and a course must have the information about the students taking that course.

Task 3 - Extending the UI

Extend your user interface (UI) (i.e. console-based menu) meeting the requierements stated above.

  1. Allow users to create a student object. The user should be able to:
    • Enter student’s full name
    • Enter student ID
    • Enter courses taken by the student
  2. Allow users to see a student’s weekly plan by entering a student’s ID. All courses that the student takes should be printed on the screen.
  3. Allow users to see which students take the course. Hence, this information should be seen when courses are listed or queried. The only information visible to the user must be student IDs. Any other information must be hidden from the user. However, all students taking that course must be reachable from that course.
  4. Please add necessary checks for wrong ID, adding nonexisting courses…etc

Task 4

Refactor your code. In addition to appropriate naming, clean and short and well-defined functions, apply what you have learnt from formatting lecture. Make sure that you don’t have any code smells in your code.

Grading

  • TDD (10)
  • Functionality (25)
    • Writing Student class: 7
    • New user-interaction functionality: 10
    • Making necessary connections between Student and Course classes: 5
    • Erorr checks: 3
  • Clean code (35)
    • Names: 5
    • Functions: 15
    • Formatting: 15

Penalties:

  • Parsing JSON data each time user queries: -20
  • Bad CLI design: -10
  • Keeping only the student IDs in courses: - 10
  • Failing to meet the requirements for deadlines: -30