Results 1 to 4 of 4
- 10-19-2011, 12:44 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
How do I write this program with classes and methods?
Given a UML class diagram consisting of three classes: Curriculum, Course, and Lecture and reflects all the following design decisions:
i)A course is composed of zero or more lectures,
(ii),A curriculum contains (or consists of) one or more courses.
(iii) All the courses of a curriculum can be accessed from the curriculum, but not the other way around.
(iv)A course may have other courses as prerequisites.
The Course class has the following field and methods:
-protected String name,
- public String getName(),
- public void setName(String name)
Write a Java application that uses the classes and methods above.
Please help
- 10-19-2011, 11:09 PM #2
Re: How do I write this program with classes and methods?
If you have a UML diagram most of the work has been done for you. It should tell you what classes you need and what methods and variables each class should have. It is simple matter of following the diagram and typing up the skeleten code. Do not worry about any functionality just yet. Make sure it compiles. Then think about what code you need to add to the methods. Take it step by step. You need to do this. Make an attempt. When you get stuck come back here post your code, post error messages and ask a specific question. "I don't know what to do" is not specific.
- 10-22-2011, 10:51 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
Re: How do I write this program with classes and methods?
Hi,
I actually am new to OOP. I do not have the diagram yet so i need to draw it. This is the exact quiz i was asking:
Draw a UML class diagram consisting of three classes: Curriculum, Course, and Lecture. Your class diagram should reflect all the following design decisions:
A course is composed of zero or more lectures.
A curriculum contains (or consists of) one or more courses. All the courses of a curriculum can be accessed from the curriculum, but not the other way around.
A course may have other courses as prerequisites.
The Course class has the following field and methods:
o protected String name
o public String getName()
o public void setName(String name)
You should use the standard UML notation, especially for field and method declarations, and justify your decisions choosing particular kinds of relationships (association, aggregation, and composition).
b) Write a Java application that uses the classes and methods in i) above
Please how do i come up with the diagram for me to code in java?
pLEEASE HELP
-
Re: How do I write this program with classes and methods?
Here are some nice tutorials on how to create and use UML diagrams:
UML Tutorial
Practical UML™: A Hands-On Introduction for Developers
UML Tutorial: Part 1 -- Class Diagrams
Good luck and hope these help!
Similar Threads
-
Trouble with static methods and boolean equals() methods with classes
By dreamingofgreen in forum New To JavaReplies: 8Last Post: 04-16-2012, 11:00 PM -
which classes to write..how to program this?
By sony1 in forum New To JavaReplies: 7Last Post: 09-04-2010, 06:12 PM -
What classes and methods to use?
By chyrl in forum Advanced JavaReplies: 21Last Post: 06-20-2010, 12:45 PM -
using methods between classes
By soccer_kid_6 in forum New To JavaReplies: 2Last Post: 04-18-2010, 03:14 AM -
Classes and Methods help
By border9 in forum New To JavaReplies: 5Last Post: 01-30-2009, 06:51 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks