• 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

its right ??

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Design and write a Java class definition for a Cube object. The object should be
capable of reporting its surface area and volume. The surface area of a cube is six
times the area of any side. The volume is calculated by cubing the side. Draw a
UML class diagram to describe your design of the Cube class before providing its
implementation.


my solution is :

import java.io.*;
public class Cube
{
private double side;


public Cube (double d){
side=d;
}
public double calculateArea(){
return 6*side*side;
}

public double calculateVolume(){
return side*side*side;
}


so, i want to under stand how can i arrang my code
could any one write to me the step so can i follow it


thanks
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey only ,

I have 1 question for you before I answer to your post:

Can you plz change your name to your real name and surname? It's much better when ppl here ask and reply with real names...

Your code looks right, you should be able to draw UML diagram pretty easy //note : delete that import statement,no need for importing InputOutput package with this imlementation and plz use "UBB CODE" when you post code, that option is located under text editor:




kind regards
Igor

[ February 23, 2005: Message edited by: Igor Stojanovic ]
[ February 23, 2005: Message edited by: Igor Stojanovic ]
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey igor...lol maybe his name is "moone only".....its a crazy world but you gota remeber there is an actual person with the name "Moon Unit Zappa" son of frank zappa, i do believe...sketchy hahah.Just posting for fun
 
reply
    Bookmark Topic Watch Topic
  • New Topic