Trinh Tong před 6 roky
rodič
revize
655c41d27f
2 změnil soubory, kde provedl 0 přidání a 152 odebrání
  1. 0
    58
      Adv.java
  2. 0
    94
      AdvCalc.java

+ 0
- 58
Adv.java Zobrazit soubor

@@ -1,58 +0,0 @@
1
-
2
-/**
3
-* Scientific Calculator Lab
4
-* Advanced Calculator Scientific Menu Options
5
-*/
6
-public class Adv
7
-{
8
-    // instance variables - replace the example below with your own
9
-    private int memory = 0;
10
- 
11
-    
12
-    /**
13
-    * switch display mode
14
-    * - Binary
15
-    * - Octal
16
-    * - Decimal
17
-    * - Hexadecimal
18
-    */
19
-    public int sampleMethod(int y)
20
-    {
21
-        // Base Mode
22
-        Console.println("Base Mode");
23
-        // Ask for input
24
-        Integer i = Console.getIntegerInput("Enter an integer");
25
-        // Display base options
26
-        // Ask for base option input
27
-        
28
-        return 2;
29
-    }
30
-    
31
-    /**
32
-     * 
33
-    * Memory Mode
34
-    * M+ = add currently displaced value to the value in memory default 0
35
-    * MC = clear memory
36
-    * MCR = display memory
37
-    * 
38
-    */
39
-    public void memory()
40
-    {
41
-        // Memory Mode
42
-        // Ask for input
43
-        // Display memory menu
44
-        // memory option input, if statement
45
-    }
46
-    
47
-    /**
48
-    * switch display mode
49
-    * - Binary
50
-    * - Octal
51
-    * - Decimal
52
-    * - Hexadecimal
53
-    */
54
-    public void toTrig(int y)
55
-    {
56
-        //calls to the trig menu
57
-    }
58
-}

+ 0
- 94
AdvCalc.java Zobrazit soubor

@@ -1,94 +0,0 @@
1
-    
2
-/**
3
-* 4.2 Scientific Calculator Group Project
4
-* Trinh Tong, Lauren Green, Michelle Dimarino
5
-* Advanced Calculator Menu
6
-*/
7
-public class AdvCalc 
8
-{
9
-
10
-    private double memory = 0;
11
-
12
-    /**
13
-     * Switch Display Mode method 
14
-     * -> binary, octal, decimal, hexadecimal
15
-     * switchDisplayMode() rotates through the options
16
-     * switchDisplayMode(String mode) sets the display to the mode given
17
-     */
18
-    public void switchDisplay(String mode)
19
-    {
20
-        int baseInput = Console.getIntegerInput("Enter an integer to see the base conversions.");
21
-        
22
-        Console.println("Display Options" 
23
-                         + "\nBinary: " + null
24
-                         + "\nOctal: " + null
25
-                         + "\nDecimal: " + null
26
-                         + "\nHexadecimal: " + null
27
-                         + "\n");
28
-        
29
-        mode = Console.getStringInput("Enter the base option to display.");
30
-        if (mode.toLowerCase().equals("binary") == true) {
31
-            
32
-        } else if (mode.toLowerCase().equals("octal") == true) {
33
-            
34
-        }
35
-        
36
-
37
-    }
38
-    
39
-    /**
40
-     * Converts the user input into octal and returns a string of that octal.
41
-     */
42
-    public String toOctal(int userInput) {
43
-        
44
-        return Integer.toOctalString(userInput);
45
-        
46
-    }
47
-    /**
48
-     * Store 1 numeric value in memory for recall later
49
-     * M+ = add currently displayed value to the value in memorie (default = 0)
50
-     * MC = reset memory
51
-     * MRC = recall current valie from memory to display
52
-     */
53
-    public void memory()
54
-    {
55
-        // Memory menu
56
-        Console.println("Memory Mode");
57
-        // Ask for input of a number
58
-        double memoryInput = Console.getDoubleInput("Enter a number to store. ");
59
-        // Display memory keys
60
-        Console.println("Memory Options: " 
61
-                         + "\nM+ : adds input to memory"
62
-                         + "\nMC : clears current memory"
63
-                         + "\nMRC : displays current memory input");
64
-                         
65
-        String memorySelect = Console.getStringInput("What would you like to do? (Enter the key)");
66
-
67
-        
68
-        if (memorySelect.equals("M+") == true) {
69
-            // M+
70
-            memory = memoryInput;
71
-            
72
-        } else if (memorySelect.equals("MC") == true) {
73
-            // MC
74
-            memory = 0;
75
-            
76
-        } else if (memorySelect.equals("MCR") == true) {
77
-            // MCR
78
-            Console.println(Double.toString(memory));
79
-        
80
-        }
81
-        
82
-    }  
83
-    
84
-    
85
-    /**
86
-     * To Trig -
87
-     * sends user to trig functions of the calculator
88
-     */
89
-    public void toTrig(int y)
90
-    {
91
-        // calls the trig menu
92
-        
93
-    }
94
-}