Starting from:

$25

CSE271 Lab 7&8 – Solved

For this two-part lab, we are going to apply the five-step process we learned in class to help us design and develop programs: 

1.    Gather requirements.

2.    Use CRC cards to find classes, responsibilities, and collaborators.

3.    Use UML diagrams to record class relationships.

4.    Use javadoc to document method behavior.

5.    Implement your program.

We are going to step through this process for a very small and simple use case.    In order to guide you through the process, you can follow through and emulate Section 12.3 in the textbook, which does the exact same thing, but for printing an Invoice. 

FOLLOW THE STEPS IN ORDER! 

Updated TA Office Hours
You are welcome to go to office hours for TAs from any section!

•       Dustin Riley, rileydm3@miamioh.edu  , Tuesday 730-830pm Benton 002

•       Emily Pantuso, pantusen@miamioh.edu  , Monday 700-800pm Benton 002

•       Gage Laufenberg, laufengd@miamioh.edu  , Monday 9-10pm Benton 002

•       Michael Gentile, gentilm5@miamioh.edu  , Tuesday 830-930 Benton 006

•       Brendan Nofs, nofsbm@miamioh.edu , Sunday 6-7PM , Benton 006

•       Rob Koch, kochrt@miamioh.edu , Sunday 7-8pm, Benton 006

•       Thomas Burlett, burlette@miamioh.edu , Sunday 8-9pm, Benton 006

•       Sarah Edmonds, edmondsh@miamioh.edu , Sunday 9-10pm, Benton 006

Part 1 – Requirements (Lab 7 - 5 Points) 
(You only need to design and implement what is necessary to achieve the following set of requirements)

We are going to build a very simple course registration system.  A Course has assigned to it 1 Instructor and 1 LectureHall. A Course can have many registered Students. A LectureHall has a capacity, meaning how many students it can hold, and a name/identifier. Students, Instructors, and AdminStaff are all People belonging to the University, and all People have an ID# and an email address.  In addition, Students have a major, a list of Courses they are taking, and a single final cumulative semester GPA.  Instructors and AdminStaff have a salary.  An AdminStaff must be able to (have methods that) 1) enroll a single Student in a Course, 2) assign a Course a LectureHall, and 3) assign a Course an Instructor.  Instructors must have the ability(methods) to 1) assign/change each Student’s single final cumulative semester GPA and 2) retrieve a list of courses they are teaching (that they have been assigned). 

In the interest of simplicity, we do not provide a user interface (except for bonus below). Just provide a test program that tests each of the functions/operations applied above.

For the 5 points in part 1, you must list

1.       All the nouns in these requirements, representing candidate classes. 

2.       All the verbs. 

Save this information as PDF file called Part1.pdf 

Part 2 – CRC Cards (Lab 7 - 10 Points)
As we did in class, discover and identify classes and create CRC cards including classes, responsibilities, and collaborators.   You can/should also follow Section 12.3.2 from the textbook. Make sure to include all appropriate responsibilities and their collaborators.   Also remember that as you discover responsibilities, you may need to add other responsibilities to other classes. A reminder that you do not need to include getters and setters, but can if you think it is integral to that class.

You can create your CRC Cards as tables in word or any other electronic file format you wish.   Save it as a PDF called Part2.pdf

Part 3 - UML Class Diagrams (Lab 7 - 15 Points)
After you have discovered classes and their relationships with CRC cards, you should record your findings in a UML diagram. The dependency relationships come from the collaboration column on the CRC cards. Each class depends on the classes with which it collaborates.  Ensure you use all appropriate UML relationships that we have taught in class from our selection of 4 relationships.  Follow Section 12.3.3 from the textbook as an example. 

You can submit your UML Class diagrams in any electronic format you wish. There are many online UML tools you can use/download for free including ArgoUML, which is fairly popular and easy to use, and https://www.draw.io/ tool, which a lot of students have enjoyed in the past.   You could also just draw it by hand and scan it in, ensuring it is legible. 

You are allowed to use/create the simplistic UML diagrams we went over in class, or the more complicated full versions you may find online and in advanced courses.

 

Submit your UML diagram as a PDF called Part3.pdf

Part 4 – Javadoc (Lab 8 – 10 Points)
The final step of the design phase is to write the documentation of the discovered classes and methods. Simply write a Java source file for each class, write the method comments for those methods that you have discovered, and leave the bodies of the methods blank until Part 5.  REMEMBER TO USE PACKAGES as we discussed in class (edu.miamioh.yourUserID)!  Then, use Javadoc comments to record the behavior of the classes. 

Look at Section 12.3.4 for an example.  You can also search online for tons of resources like https://www.youtube.com/watch?v=Hx-8BD_Osdw .  

Javadoc is in the form of 

/**

      Overall method comments

      @param param1 Description of parameter 1

      @param paramn Description of parameter 2

                    @return Description of what is returned

 */

                Public int myMethod (int param1, String param2){

… 

Proper Javadoc in your code is worth 10 points.  We will be looking very closely at it. 

Part 5 – Implementation (Lab 8 – 20 Points)
After you have completed the object-oriented design, you are ready to implement the classes.  You already have the method parameter variables and comments from the previous step. Now look at the UML diagram to add instance variables. Aggregated classes prescribe the use of instance variables, which can be collections or individual objects.

Follow all the implementation rules and standards we have been following thus far.  For testing, make an additional tester class program that runs through and tests (Actual versus expected/4 step process) for all functions/operations designed and implemented above.  This includes checking that things were added to the appropriate lists.

Part 6 – Bonus (Lab 7+8 – 10 points)
Create a Graphical User Interface (GUI) for your course registration system.  If you need to learn or review GUIs, read Chapter 10 in the text book.   There are no real requirements here except that the GUI utilizes the classes you developed.  Points here will be given based on how many features and how well laid out your GUI is.  It is bonus because you will have to read ahead and learn some skills on your own. So, do not feel pressured to do it, but it will help you with future material to come.

Tips
Often times, you can think of your collaborators for each responsibility as "method parameters". For example, in order to enroll a student in a course, I'll need a method that takes in both a student and a course.

A reminder, class names are singular as they describe a set of individual things.  So, it would be "Person" and not "People", and "Student" not "Students".

Submission
For Lab 7 (Part 1, 2, and 3), submit the three correctly named PDFs to CANVAS by 1159pm on March 28th. 

For Lab 8 (Part 4 and 5 and Bonus), Turn in a .zip file of your “src” directory to CANVAS by 1159pm on March 28th . Ensure they are in the proper package. 

Grading will be based on conforming to the standards we reviewed in class as well as following the requirements of these two Labs.  

More products