1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- /**
- * CustomFeatures found here.
- *
- * @author (David Thornley)
- * @version (0.1)
- */
-
- public class CustomFeatures
- {
- // instance variables - replace the example below with your own
- Console console = new Console();
-
- public String help = "";
-
- /**
- * Constructor for objects of class CustomFeatures
- */
- public CustomFeatures(Console c)
- {
-
- console = c;
- }
-
- public double addFive () {
- return console.changeCurrentValue(console.getCurrentValue() + 5);
- }
-
- public String helpMe () {
- return help = "Welcome to the help file! \n" + " \n" +
-
- "All of the available commands are listed below \n" +
- "with a short description for each command. \n" + " \n" +
-
- "Basic Commands: \n"+
- "getValue -> shows you the current stored value in the calculator \n" +
- "clear -> resets the current value to 0 \n" +
- "changeValue -> sets the current value to a user defined number \n" +
- "add -> adds current value to a user defined number \n" +
- "subtract -> subtracts a user defined number from the current value \n" +
- "multiply -> multiplies the current value by a user defined number \n" +
- "divide -> divides current value by a user defined number \n"+
- "square -> squares the current value (current value to the 2nd power) \n" +
- "SQRT -> calculates the square root of the current value \n" +
- "inverse-> calculates 1/(current value) \n" +
- "invert -> switches value of current value to negative or vice versa \n" +
- "variableEx -> calculates the current value to the user defined power \n" +" \n" +
-
- "Scientific Commands: \n" +
- "switchDisplayMode -> changes display mode to binary, octal, decimal, hexadecimal \n" +
- "M+ -> Add the currently displayed value to the value in memory \n" +
- "MC -> resets memory value to 0 \n" +
- "MRC -> recalls the stored memory value \n" +
- "sine -> Calculate the sine of the current value \n" +
- "cosine -> Calculate the cosine of the current value \n" +
- "tangent -> Calculate the tangent of the current value \n" +
- "inverseSine -> 1/(sine of current value) \n" +
- "inverseCosine -> 1/(cosine of current value) \n" +
- "inverseTangent -> 1/(tangent of current value) \n" +
- "switchUnitsMode -> sets trig units to Degrees or Radians \n" + " \n" +
-
- "Bonus Features: \n" +
- "factorial -> calculates the factorial of the current value \n" +
- "log -> calculates the log of the current value \n" +
- "inverseLog -> calculates 10^(current value) \n" +
- "LN -> calculates the natural logarithm of the current value \n" +
- "inverseLN -> calculates e^(current value) \n" + " \n" +
-
- "Custom Features: \n" +
- "addFive -> sets current value to result of five plus the current value \n" +
- "help -> displays this help file \n" +
- "exit -> closes the calculator \n";
-
-
-
- }
- }
|