/** * Author: Josiah Yoder et al. * User: yoder * Class: SE1011-011 * Date: 10/17/13 8:28 AM * Lesson: Week 6, Day 1 */ public class Example051_7_1 { /* * This is a scratch-paper method */ public static void main(String[] ignored) { // Principles for selecting fields // 1. Choose the smallest number of variables that // can completely describe any object of that type // 2. As simple to work with as possible Complex051_7_1 c = new Complex051_7_1(3,4); Complex051_7_1 c2 = new Complex051_7_1(0,0); Complex051_7_1 c3 = new Complex051_7_1(0,0); // We have not implemented these yet. // c3 = c.add(c2); // c3 = c.subtract(c2); // c3 = c.multiply(c2); // c3 = c.divide(c2); // We have not implemented these yet. // How would you put them in the UML diagram? // c.dance(); // :-) // c3 = c.pow(c2); // c.radicalArgument(); // c.radicalMagnitude(); // // c.magnitude(); // alternative name for radical magnitude // this is just the method by itself, with the return value ignored // Example051_7_1 of getting the return value back and storing it in a variable double mag = c.magnitude(); } }