Java Help

Man of Honour
Joined
15 Mar 2004
Posts
28,140
Location
Liverpool
Ok I have assignments to do, first of all - I'm not asking for the answers themselves (I'm not putting up any code - so nobody can give them to me anyway), but I'm having trouble understanding I need to write about the question itself.

Not only do we have to solve a given problem using Java but we hand in some documentation:

question sheet said:
Design your class system. This involves understanding what the classes in the implemented
system will be and what are their attributes. For each of the attributes you should describe
what is its type plus any constraint on its values (these will have to be enforced/verified by
your program).

For this part I have to describe what type are my attributes (? - what does this mean? Does this mean e.g. if I've defined integers/floats at the top of my program - I need to talk about them, and then say if they're e.g. variable or static?)

question sheet said:
2. Define the various operations in each class, including any relevant constructor and, of course,
the main method in the application class. Use pseudo-code to describe each method. The
pseudo-code should use ONLY previously defined identifiers (do not invent new/alternative
names for something that you have already given a name to).

Define the various operations in each class - does this mean I have talk about what each class exists for/what it does (including what's in the method class)? And this has to be in pseudo code?

question sheet said:
3. At this point you should draw the complete class diagram (this will guide you through the
next step).

Draw a class diagram, ok that seems simple enough (I think..)
 
Design your class system. This involves understanding what the classes in the implemented
system will be and what are their attributes. For each of the attributes you should describe
what is its type plus any constraint on its values (these will have to be enforced/verified by
your program).

I'd say this part was basically asking you to describe what fields you are going to declare at the top of your class. It wants their type and any range they may need

e.g. private String Name; (This value should be between 2 - 20 characters)

Something like that for each field you plan on using

2. Define the various operations in each class, including any relevant constructor and, of course,
the main method in the application class. Use pseudo-code to describe each method. The
pseudo-code should use ONLY previously defined identifiers (do not invent new/alternative
names for something that you have already given a name to).

This is asking for you to define the class constructor. It also wants you outline what methods you are going to use in the class and write them out.

e.g.

public int randNumber(){

int number = (int)((Math.random()*10)+1);
Return number;

}
 
Design your class system. This involves understanding what the classes in the implemented system will be and what are their attributes. For each of the attributes you should describe what is its type plus any constraint on its values (these will have to be enforced/verified by your program).

Similar to Gaverick I'd say explain what the attribute is, for example:

Code:
private String name;    // The customers name (2-20 characters)
private int balance;    // The current account balance (any positive value)

2. Define the various operations in each class, including any relevant constructor and, of course, the main method in the application class. Use pseudo-code to describe each method. The pseudo-code should use ONLY previously defined identifiers (do not invent new/alternative names for something that you have already given a name to).

I would write out the method headers (including the main method and constructor(s)) and then use pseudo-code to describe the body, for example:

Code:
public boolean debitAccount (int amount)
{
if balance - amount < 0
then return false
else balance = balance - amount
endif
return true
}

3. At this point you should draw the complete class diagram (this will guide you through the
next step).

You should use correct UML notation listing the names, attributes and methods of each class and draw in the correct relationships between the classes if neccesary.
 
Back
Top Bottom