Results 1 to 4 of 4
  1. #1
    bossyboy is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default 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

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default 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.

  3. #3
    bossyboy is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default 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

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. which classes to write..how to program this?
    By sony1 in forum New To Java
    Replies: 7
    Last Post: 09-04-2010, 06:12 PM
  3. What classes and methods to use?
    By chyrl in forum Advanced Java
    Replies: 21
    Last Post: 06-20-2010, 12:45 PM
  4. using methods between classes
    By soccer_kid_6 in forum New To Java
    Replies: 2
    Last Post: 04-18-2010, 03:14 AM
  5. Classes and Methods help
    By border9 in forum New To Java
    Replies: 5
    Last Post: 01-30-2009, 06:51 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •