howd you draw class digarams
for example from the follwing code,:
import javax.swing.*;
public class PriceOfCoffee {
public static void main(String[] args) {
int numberOfUnits, unitWeight;
final double pricePerPound=5.99;
double totalPrice, totalPriceWithTax;
final double salesTax=0.0725;
String inputStr;
inputStr = JOptionPane.showInputDialog(null, "Number of bags sold: ");
numberOfUnits = Integer.parseInt(inputStr);
inputStr = JOptionPane.showInputDialog(null, "Weight per bag: ");
unitWeight = Integer.parseInt(inputStr);
// computation
totalPrice = unitWeight * numberOfUnits * pricePerPound;
totalPriceWithTax = totalPrice + totalPrice * salesTax;
System.out.println("Number of bags sold: " + numberOfUnits);
System.out.println(" Weight per Bag: " + unitWeight + "lb");
System.out.println(" Price per pound: $" + pricePerPound);
System.out.println(" Sales tax: 7.25%");
System.out.println(""); // miss a line
System.out.println(" Total price: $" + totalPriceWithTax);
}
}
varies according to the university or boss who is asking
i would draw a big square box
in the top left corner i would list the member variables, using italics for private/protected ones
then i would draw a sequence of rectangles sticking out of the right hand side of the box, with the method names, public-ness and expected arguments in them. see the attachment
this might not be how your uni expects. CHECK.
also, final variables should BE_WRITTEN_LIKE_THIS, k?
Attached Images
Attached Images
You can use a program like Visio to draw diagrams like relational or flow charts.
lol, but for the amount of time it takes to load visio, and learn it.. might as well use paint!! or word.. lol
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
Bookmarks