• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java UML Class

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

Firstly I must say what an excellent forum this is, I'm very happy I found it. I have been tasked to create a UML class diagram and an object diagram, unfortunately I have no idea how to put it together.

The application I have been coding is a simple calculator with four different functions (add, subtract, multiply and divide).

Here is my code, any help would be appreciated!

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alex,
Welcome to CodeRanch!

The second diagram on this page shows a class diagram.


Since you only have one class and no instance variables, your class diagram will be very simple. It'll be a box with an empty top section and the methods in the bottom section.

An object diagram doesn't apply because you don't have any states - only static methods. Maybe your teacher wants you to have instance variables?
 
Alex Arcay
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your helpful message. I would like to just ask if you think I can complete this task simply? I am trying to get signed off my course as soon as possible (before university in September) and this is the last thing holding me back unfortunately! I have already made the calculator, I just need to make the diagrams.

My task information for this part:

3a) Design an OOP application using UML Class and Object diagrams that represents a Library management system. The scope of the application is up to you in terms of how simple or complex it is, but it must be realistic in its considerations of different objects and attributes. – P3

3b) Implement a working object oriented application based on the Library management system designed above. The application must accurately replicate the class and object diagrams designed above.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The assignment talks about a library, not a calculator. Also, I don't think your calculator program is designed in a way that will let you complete the assignment.

In order to complete this task, it looks like you are going to have to learn about instance variables and how to create a program with multiple classes. Luckily, September is a few months away so you have plenty of time.
 
I child proofed my house but they still get in. Distract them with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic