Page 1 of 1

(a) Draw a sequence diagram which corresponds to the Java code given below, beginning with the call to the printCourses(

Posted: Fri May 20, 2022 6:55 pm
by answerhappygod
A Draw A Sequence Diagram Which Corresponds To The Java Code Given Below Beginning With The Call To The Printcourses 1
A Draw A Sequence Diagram Which Corresponds To The Java Code Given Below Beginning With The Call To The Printcourses 1 (72.13 KiB) Viewed 47 times
(a) Draw a sequence diagram which corresponds to the Java code given below, beginning with the call to the printCourses() method in the courseUI class. Note: 1. You must include all details given in the program below. 2. You must show return messages, with labels where appropriate. public class CourseUI { private CourseController controller; public void printCourses() { ArrayList<Course> printList = controller.printCourses(); } } public class CourseController { private Courselist courselist; public ArrayList<Course> printCourses() { ArrayList<Course> printList = courselist.printCourses(); return printList; } } public class Courselist { private ArrayList<Course> courses; public ArrayList<Course> printCourses() { ArrayList<Course> printList = new ArrayList<Course>(); for (int i=0; i < courses.size(); i++) { Course aCourse = courses.get(i); String title = aCourse.getTitle(); String code = aCourse.getCode(); Course printDetail = new Course(title, code); printList.add(printDetail); } return printList; } }