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);
}
}