//******************************************************************** // Multiplier.java Author: Brenneman // // Contains methods for "multiplying" different data types. //******************************************************************** public class Multiplier { //private data private int multiplier; //----------------------------------------------------------------- // Constructs a Multiplier object which, for the purpose of testing // different mutiplying methods. Defaults multiplier to 5. //----------------------------------------------------------------- public Multiplier () { multiplier = 5; } //----------------------------------------------------------------- // integer multiply -- multiplys its integer parameter and print a // statement showing the value of n before and after multiplying. //----------------------------------------------------------------- public void multiply (int n) { System.out.println(" ---inside method multiply (int), n is "+n); n = multiplier*n; System.out.println(" ---inside method multiply (int), n is now "+n); } //----------------------------------------------------------------- // YOU WRITE THIS METHOD. // double multiply -- mutiplies its double parameter // and prints a statement showing the value of the parameter // before and after multiplying. //----------------------------------------------------------------- //----------------------------------------------------------------- // YOU WRITE THIS METHOD. // Num multiply -- multiplies the instance data of its Num parameter // and prints a statement showing the value of the parameter // before and after multiplying. //----------------------------------------------------------------- }