CS计算机代考程序代写 Java 300144 Object Oriented Analysis 300888 Object Oriented Analysis (Advanced)

300144 Object Oriented Analysis 300888 Object Oriented Analysis (Advanced)
Tutorial 7 – Sequence, Interaction Overview & State Machine Diagrams (Week 10)
Student Name: ______________________________________ Student ID: ______________________________________ Tutorial Class: ______________________________________
Instructions to students –
 Attempt all questions
 This Tutorial will contribute to your final assessment mark
 The Tutor will check your solutions when you are finished
 BICT (Advanced) students need to complete optional questions.

Project Work 7 (marked):
1. Identify sequences within your project work. They can be either the documentation of a use case or an activity diagram. Draw a sequence diagram corresponding to that sequence. Try to draw ONE sequence diagram for each of the main use cases within your package.
2. Now consider a sequence of events that cuts across more than one use case and/or activity diagrams and draw another sequence diagram from that sequence.
3. Each sequence diagram may typically contain four to six objects in it (just for reference, not necessary to be exactly in this range)
4. Notice how the drawing of sequence diagrams could update the corresponding class diagrams. The updates are in terms of classes’ attributes and operations, as well as discovery of new classes. If you discover new classes as a result of drawing the sequence diagrams, update the class diagrams.
5. Draw at least ONE interaction overview diagram per package. This diagram, based on your package, could include references of use cases and sequence diagrams of other packages. Ensure you have shown scenarios containing “if- then-else” with use cases and/or sequence diagrams of your system (decision points) and including parallel processes (if any).
6. Draw TWO state machine diagrams with two important, dynamic and complex objects of each package. Investigate how their states will change based on the messages they receive throughout their lifecycle. Apply the transitions to these states, add guard conditions and identify nested states where applicable.
7. Ensure you have added enough notes on all your diagrams drawn in your CASE tool to clarify your analysis work.
Note: As this week project work is a guideline toward to the completion of the project, so for this tutorial, you are required to produce one “good” diagram for each type, i.e. one sequence diagram, one interaction overview diagram and one state machine diagram. The available UML tools might not have the identical type of the diagrams, thus you need to check all available UML types to find the ingredients for certain diagrams.
Tutorial Exercises (Optional):
Draw the state machine based on the following Java program (you may run the program first):
import java.io.*; // program uses for I/O

class Student {
protected long studentID;
protected static long nextNum = 20000000;
protected String name, course, status;
protected boolean enrolled;
protected boolean atRisk;
protected boolean suspended;
protected boolean completeCourse;
protected boolean completeMajor;
protected boolean removed;
Student() {
studentID = ++nextNum;
enrolled = true;
atRisk = false;
suspended = false;
completeCourse = false;
completeMajor = false;
}
public void displayDetails() {
System.out.println(“\nstudentID: ”
+ studentID + “, Name: ”
+ name + “, Course: ” + course
+ “\nStatus: “+ status);
}
public void setName (String aName) {
name=aName;
}
public void setStatus(String aStatus){
status = aStatus;
} }
class StudentBICT extends Student {
StudentBICT() {
course=”BICT”;
} }
class StudentBIS extends Student {

StudentBIS() {
course=”BIS”;
} }
class StudentBCS extends Student {
StudentBCS() {
course=”BCS”;
} }
public class CourseStudy {
public static void main(String[] args) throws
IOException
{
int year=1;
final int maxYear=5;
String inputStr;
char yesOrNo;
BufferedReader input = new BufferedReader(new
InputStreamReader(System.in));
// create InputStreamReader to obtain input
from command window
Student oneStudent = new StudentBICT();
oneStudent.setName(“Mary A. Smith”);
while (year++ <= maxYear) { or N: " ); System.out.print( "Stude complete course? Y inputStr = input.readLine(); yesOrNo = inputStr.charAt(0); if (Character.toUpperCase(yesOrNo) =='Y') { oneStudent.completeCourse = true; System.out.print( "Stude complete major as well? Y or N: " ); =='Y') { inputStr = input.readLine(); yesOrNo = inputStr.charAt(0); if (Character.toUpperCase(yesOrNo) oneStudent.completeMajor = true; } break; } else if (year>maxYear) {
complete course in 5 years
//need
N: ” );
==’Y’) {
at risk
time at risk
else {
System.out.print( “Stude at risk? Y or
inputStr = input.readLine();
yesOrNo = inputStr.charAt(0);
if (Character.toUpperCase(yesOrNo)
if (oneStudent.atRisk) { //already
oneStudent.suspended = true;
break; }
improved, clear atRisk
}
}
oneStudent.removed = true;
break; }
} else
else
//first
oneStudent.atRisk = true;
oneStudent.atRisk = false; //
if (oneStudent.completeCourse &&
oneStudent.completeMajor)
oneStudent.setStatus(“Graduate with Degree
and Major”);
else if (oneStudent.completeCourse)
Degree”);
oneStudent.setStatus(“Graduate with
else if (oneStudent.suspended)
oneStudent.setStatus(“Suspended”);
else
oneStudent.setStatus(“Removed”);
oneStudent.displayDetails();
}
}
Hint: The state of one student object is as “enrolled” at the beginning and has four different statuses at the end; “graduate with degree and major”, “graduate with degree”, “suspended” and “removed”.