[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

UML help

Posted on 2011-10-23
5
Medium Priority
?
434 Views
Last Modified: 2012-05-12
This question is about making sure proper UML notations are used to accomplish the followings. Coding questions, if any, will be asked in a new post.

Class name: MyInteger to have...

- An int data field named value that stores the int value represented by this object

- A constructor that creates a MyInteger object for the specified int value.

- A get method that returns the int value.

- Methods isEven(), isOdd(), and isPrime() that returns true or false

- Static methods isEven(), isOdd(), and isPrime() that returns true or false

- Static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that returns true or false.

- Methods equals(int) and equals(MyInteger) that returns true or false.

- A static method parseInt(char[]) that converts an array of numeric characters to an int value.

- Methods equals(int) and equals(MyInteger) that returns true or false.

- A static method parseInt(char[]) that converts an array of numeric characters to an int value.

- A static method parseInt(char[]) that converts an array of numeric characters to an int value.

This is from an old text book but it is not classwork. I am stuiying it to make sure all of the points are understood. With focus on UML at this point.

Below, I have done as much as I knew how. There are areas that need to be modified. Could you please review and let me know how I can corrects the errors in it?


Thank you.
UML-1.png
0
Comment
Question by:Mike Eghtebas
  • 3
  • 2
5 Comments
 
LVL 10

Assisted Solution

by:Gregg
Gregg earned 2000 total points
ID: 37015638
on thing i see so far is missing the setter. In the event the default constructor is used, setter is needed.

+ setValue(int: value) : void
0
 
LVL 10

Expert Comment

by:Gregg
ID: 37015646
just curious, why do you want to use static for your methods?
0
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 0 total points
ID: 37028273
gregg_s,

Thank you for the response.

re:> just curious, why do you want to use static for your methods?

This is the statement of the problem. I am not choosing to use static.

See:

http://www.experts-exchange.com/Programming/Languages/Java/Q_27415318.html

Mike
0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 37052384
I was able to complete the UML portion.
0
 
LVL 10

Expert Comment

by:Gregg
ID: 37053119
Thanks eghtebas, You really did an excellent job on UML diagram.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question