0 Comments

Description

In information systems, a program often needs to respond differently
in different circumstances. For example, a system monitoring blood
pressure would need to respond differently for low, normal, and high
blood pressures. Or, a course registration system would need to notify a
student if a class was full.

Such differentiated responses utilize if-then or case
statements within class methods. You implemented an example if-then
statement in Benchmark 3. You have already incorporated or will be
incorporating this decision-based logic into a class method in Benchmark
4. Many class methods and programs in general make extensive use of
decision-based logic to differentiate what the program will do for
various cases.

As one example, the monitor blood pressure method in the
Vitals class needs to check blood pressure on a regular basis, update
the current blood pressure properties, and give a warning if there is a
low or high reading. The decision point is needed to give that warning.
Pseudo-code for that decision might be:

As another example, the add_course method in the Registration
class would need not only to add the course to the array for the student
but would also need to interact with a separate Course class to include
the student on the list for that course. It would also likely need to
interact with other system aspects like checking prerequisites and such,
but for the example, just consider that basic registration interaction
of adding to the course list and the student list. A decision point is
needed to address the situation where the course is full. Assume that
the Course class has a method called add_student() which returns either
“added” or “full”. Then, the decision statement for the add_course in
the Registration class might be:

In the Discussion this week, numerous examples of classes with
associated variables and methods were generated. Choose one of the
methods that requires a decision be made by the program. It may be a
method from the class you described in the Discussion, a method from one
of the examples, or a method from a class described by one of your
colleagues.

  1. Give the associated UML class diagram and explain your
    chosen method. Include what the method does, what class properties the
    method accesses or writes, and what other aspects of the class or system
    the method needs to interact with.
  2. Focus in on the decision point in the method. Explain what
    decision the method code has to make and why. What role does the
    decision point play in the method?
  3. Give pseudo-code with comments to explain each step for that decision using an if-then structure.

Integrate you method description and if-then pseudo-code into a
single document that fully explains the overall method, interactions
with other classes, and the role of the decision point in that method.

Integrate your method description, decision point analysis, and if-then pseudo-code into a single document with a cover sheet.

Order Solution Now

Categories: