Homework: Java AU Naturel Exercise 4.2: Draw a UML class diagram for listing 4.2 on page 4 of the book. Code for the diagram is in comments. Please help if you can.
Code: import javax.swing.JOptionPane; class NameChange { /** Ask the user for his/her first name, then for the last * name, then print them out in the opposite order. */ public static void main (String[ ] args) { JOptionPane.showMessageDialog (null, "Illustrate the use of JOptionPane methods"); String firstName = JOptionPane.showInputDialog ("What is your first name?"); String lastName = JOptionPane.showInputDialog ("What is your last name?"); JOptionPane.showMessageDialog (null, "Reversed it is " + lastName + ", " + firstName); System.exit (0); // needed when using JOptionPane } //====================== }
What troubles you? Your book should also list the format of a java uml diagram.
They have an example, but its lousy and my teacher said its for the previous chapter. and this chapter 4 has different info. She was confusing.
|dw:1416508216299:dw| I am confused on where the System goes in the diagram. I started it slowly.
Join our real-time social learning platform and learn together with your friends!