联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-11-04 10:39

Extra Lab Requirements

Use starUML to draw class diagrams for the exercises below. Have starUML generate the

Java code for you. Read and see what Java code looks like.

Submission:

1. A Microsoft Word report which contains your three class diagrams.

? Copy-paste each of the three exercises below into your report.

? Find the clues of classes, attributes, and methods in the descriptions of the

exercises, and highlight them with different kinds of underlines or colors.

? For each exercise, put the corresponding class diagram (as a picture) under the

highlighted description of the exercise.

2. The generated Java code (.java).

? Create a new folder for each exercise and put the Java code into the

corresponding folder.

3. You are supposed to submit a compressed .zip file containing the following

documents (replace “123456789” with your own student ID number):

? A .docx file for the report: “Lab1_123456789.docx”;

? Three .mdj StarUML files: “Lab1_123456789_1.mdj”, Lab1_123456789_2.mdj”,

and “Lab1_123456789_3.mdj”;

? Three folders: “Java_123456789_1”, “Java_123456789_2”, and

“Java_123456789_3”;

? Java files in each of the three folders mentioned just above.

Note: after you have created a class diagram using StarUML, you can save it in a StarUML .mdj

file using the File → Save menu, and you can create a picture of it using the File → Export

Diagram As → JPEG menu.

To generate the Java code from a UML diagram, follow these steps.

1. Use the Tools → Extension Manager menu to install the “Java” extension.

2. Restart StarUML.

3. Use the Tools → Java → Generate Code menu.

Exercise 1:

UIC is building a system for all the persons on campus. Each person has a mobile phone number.

Persons can be students or teachers or security guards. Each student has a student ID, a

dormitory number, a major, and a home address. Each teacher has an office number, a staff ID

number, and an office phone number. Each security guard has a staff ID number. Some teachers

can be mentors. For a mentor, we need to know the email address.

Exercise 2:

1. A college has two types of students: undergraduate students and graduate students.

2. A graduate student can be a TA.

3. The college also has two types of teachers: lecturers and professors.

One TA can help one lecturer or one professor. One lecturer can have at most 2 TAs, one

professor can have 4 TAs. A college can have many students and many professors, but each

student has only one college and each professor has only one college.

Exercise 3:

The UIC library has many books. The library has many users (represented as an interface) which

are of two kinds: students or teachers. There are two types of students: undergraduate students

and graduate students. Students have a student ID number and teachers have a staff ID number.

Books have an ISBN number and a status indicating whether the book is in the library or has

been borrowed. The library has the following rules:

1. All users can search for books

2. All users can borrow books.

3. All users can return books.

4. Undergraduate students can borrow at most 10 books.

5. Graduate students can borrow at most 20 books.

6. Teachers who worked in UIC for more than 5 years can borrow at most 30 books.

In addition, if you are an undergraduate student or a graduate student or a teacher then you

know which books you have, but from a book it is not possible to find out which undergraduate

student or graduate student or teacher has borrowed it.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp