On this page:
Instructions
1 Problem 1 – The Registrar’s Office
1.1 Data constraints
1.2 Methods and examples to design
2 Problem 2 – If A Buddy Catch A Buddy
2.1 Examples and instructor-test contract
8.13

Assignment 6: Cyclic data; Graphs🔗

Goals: Constructing and using cyclic data of various complexities.

Instructions🔗

As always, be very careful with your naming conventions.

The submissions will be organized as follows:

1 Problem 1 – The Registrar’s Office🔗

The registrar’s office maintains a great deal of information about classes, instructors, and students. Your task in this problem is to model that data, and implement a few methods on it. We deliberately do not give you the class diagram for this problem: from the description below, you should properly design whatever classes you think are relevant. Please use generic lists (i.e. IList<T>) for this problem.

1.1 Data constraints🔗
1.2 Methods and examples to design🔗
2 Problem 2 – If A Buddy Catch A Buddy🔗

Finish all work in the Recitation 9: Working with Cyclic Data and hand it in.

Specifically:

2.1 Examples and instructor-test contract🔗

Name the examples class ExamplesBuddies. It must define the people from the lab using lower-case field names that match their names: ann, bob, cole, dan, ed, fay, gabi, hank, jan, kim, and len.

Define void initBuddies() in ExamplesBuddies. It must initialize every person’s buddy list, and it must be safe to call repeatedly: every call must recreate the same self-consistent network rather than accumulating additional buddies from earlier calls.

The instructor tests invoke hasDirectBuddy, hasExtendedBuddy, countCommonBuddies, partyCount, and maxLikelihood using the method headers given in the lab and this assignment. If any method is unfinished, keep the exact method header and a compiling stub, and mark the stub clearly as incomplete. This lets all instructor tests compile and report which completed methods work.