Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 2.94 KB | None | 0 0
  1. class
  2.     APPLICATION
  3.  
  4. inherit
  5.  
  6.     ARGUMENTS
  7.  
  8. create
  9.     make
  10.  
  11. feature {NONE} -- Initialization
  12.  
  13.     make
  14.             -- University model demo
  15.         local
  16.             l_university: UNIVERSITY
  17.             l_course_contracts, l_course_comments: COURSE
  18.             l_instructor_bertrand, l_instructor_instructing: INSTRUCTOR
  19.             l_assistant_assisting, l_assistant_helping: ASSISTANT
  20.             l_student_alpha, l_student_bravo, l_student_charlie: STUDENT
  21.             l_year_bs1, l_year_ms1: YEAR
  22.             l_time_morning, l_time_evening: TIME
  23.             l_room_123, l_room_248: ROOM
  24.             l_teaching_week_first, l_teaching_week_last: TEACHING_WEEK
  25.         do
  26.             create l_time_morning.make (9, 15)
  27.             create l_time_evening.make (18, 30)
  28.             create l_room_123.make (123)
  29.             create l_room_248.make (248)
  30.             create l_year_bs1.make ({YEAR}.bs1)
  31.             create l_year_ms1.make ({YEAR}.ms1)
  32.             create l_instructor_bertrand.make_with_name (create {NAME}.make ("Bertrand", "Meyer"))
  33.             create l_instructor_instructing.make_with_name (create {NAME}.make ("Instructing", "Meyer"))
  34.             create l_assistant_assisting.make_with_name (create {NAME}.make ("Assisting", "Meyer"))
  35.             create l_assistant_helping.make_with_name (create {NAME}.make ("Helping", "Meyer"))
  36.             create l_course_contracts.make ("Contracting", l_year_bs1, l_instructor_bertrand, <<l_assistant_assisting>>)
  37.             create l_course_comments.make ("Commenting", l_year_ms1, l_instructor_instructing, <<l_assistant_assisting, l_assistant_helping>>)
  38.             create l_student_alpha.make_empty (create {NAME}.make ("Apple", "Alpha"), l_year_bs1)
  39.             create l_student_bravo.make_empty (create {NAME}.make ("Bending", "Bravo"), l_year_bs1)
  40.             create l_student_charlie.make_empty (create {NAME}.make ("Constant", "Charlie"), l_year_ms1)
  41.             create l_university.make_with_name ("EIFFEL4LIFE")
  42.             l_university.assistants.extend (l_assistant_assisting)
  43.             l_university.assistants.extend (l_assistant_helping)
  44.             l_university.instructors.extend (l_instructor_bertrand)
  45.             l_university.instructors.extend (l_instructor_instructing)
  46.             l_university.courses.extend (l_course_comments)
  47.             l_university.courses.extend (l_course_contracts)
  48.             l_university.students.extend (l_student_alpha)
  49.             l_university.students.extend (l_student_bravo)
  50.             l_university.students.extend (l_student_charlie)
  51.             create l_teaching_week_first.make
  52.             create l_teaching_week_last.make
  53.             l_teaching_week_first.monday.lectures.extend (create {LECTURE}.make (l_course_contracts, create {TIME_AND_ROOM}.make_at (l_room_123, l_time_evening)))
  54.             l_teaching_week_last.sunday.lectures.extend (create {LECTURE}.make (l_course_comments, create {TIME_AND_ROOM}.make_at (l_room_248, l_time_morning)))
  55.             l_university.schedule.teaching_weeks.extend (l_teaching_week_first)
  56.             l_university.schedule.teaching_weeks.extend (l_teaching_week_last)
  57.             l_student_alpha.courses.extend (l_course_comments)
  58.             l_student_bravo.courses.extend (l_course_comments)
  59.             l_student_charlie.courses.extend (l_course_contracts)
  60.             io.put_string (l_university.out)
  61.         end
  62.  
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement