Connor Dunnigan пре 6 година
родитељ
комит
e764e500ad
5 измењених фајлова са 0 додато и 207 уклоњено
  1. 0
    32
      Console.java
  2. 0
    25
      MainApplication.java
  3. 0
    104
      SwitchModes.java
  4. 0
    45
      UpdateDisplay.java
  5. 0
    1
      demo.txt

+ 0
- 32
Console.java Прегледај датотеку

@@ -1,32 +0,0 @@
1
- 
2
-
3
-import java.util.Scanner;
4
-
5
-/**
6
- * Created by leon on 2/9/18.
7
- */
8
-public class Console {
9
-
10
-    public static void print(String output, Object... args) {
11
-        System.out.printf(output, args);
12
-    }
13
-
14
-    public static void println(String output, Object... args) {
15
-        print(output + "\n", args);
16
-    }
17
-
18
-    public static String getStringInput(String prompt) {
19
-        Scanner scanner = new Scanner(System.in);
20
-        println(prompt);
21
-        String userInput = scanner.nextLine();
22
-        return userInput;
23
-    }
24
-
25
-    public static Integer getIntegerInput(String prompt) {
26
-        return null;
27
-    }
28
-
29
-    public static Double getDoubleInput(String prompt) {
30
-        return null;
31
-    }
32
-}

+ 0
- 25
MainApplication.java Прегледај датотеку

@@ -1,25 +0,0 @@
1
- 
2
-
3
-/**
4
- * Created by leon on 2/9/18.
5
- */
6
-public class MainApplication {
7
-    public static void main(String[] args) {
8
-        
9
-        double Display = 0;
10
-        int num_system = 1;
11
-        double memory = 0;
12
-        
13
-        Console.println("Welcome to my calculator!");
14
-        Console.println("Choose your option : ");
15
-        
16
-        String s = Console.getStringInput("Enter a string");
17
-        
18
-        while (s != "quit") {
19
-            
20
-        Integer i = Console.getIntegerInput("Enter an integer");
21
-        Double d = Console.getDoubleInput("Enter a double.");
22
-    }
23
-
24
-    }
25
-}

+ 0
- 104
SwitchModes.java Прегледај датотеку

@@ -1,104 +0,0 @@
1
-
2
-/**
3
- * Write a description of class SwitchModes here.
4
- *
5
- * @author (your name)
6
- * @version (a version number or a date)
7
- */
8
-public class SwitchModes
9
-{
10
-    // instance variables - replace the example below with your own
11
-    private int displayMode=1;
12
-    private int unitMode=1;
13
-
14
-    SwitchModes sm = new SwitchModes();
15
-
16
-    public int getDisplayMode(){
17
-        return displayMode;
18
-    }
19
-
20
-    public void setDisplayMode(int mode){
21
-        displayMode=mode;
22
-    }
23
-
24
-    public int getUnitMode(){
25
-        return unitMode;
26
-    }
27
-
28
-    public void setUnitMode(int mode){
29
-        unitMode=mode;
30
-    }
31
-
32
-    /**
33
-     * Constructor for objects of class SwitchModes
34
-     */
35
-    public SwitchModes()
36
-    {
37
-        // initialise instance variables
38
-    }
39
-
40
-    /**
41
-     * An example of a method - replace this comment with your own
42
-     *
43
-     * @param  y  a sample parameter for a method
44
-     * @return    the sum of x and y
45
-     */
46
-
47
-    public void switchDisplayMode (String mode){
48
-        mode.toLowerCase();
49
-        switch (mode) {
50
-            case "hex": { 
51
-                displayMode=1;
52
-                // call update display
53
-                break;
54
-            }
55
-            case "bin": { 
56
-                displayMode=2;
57
-                // call update display
58
-                break;
59
-            }
60
-            case "dec": { 
61
-                displayMode=3;
62
-                // call update display
63
-                break;
64
-            }case "oct": { 
65
-                displayMode=4;
66
-                // call update display
67
-                break;
68
-            }
69
-        }
70
-    }
71
-
72
-    public void switchDisplayMode(){
73
-        if (displayMode==4){
74
-            displayMode=1;
75
-            // call update display
76
-        } 
77
-        else {
78
-            displayMode++;
79
-            // call update display
80
-        }
81
-
82
-    }
83
-
84
-    public void switchUnitsMode (String mode){
85
-        if (mode.toLowerCase()=="degrees") {
86
-            unitMode=1;
87
-
88
-        } else if(mode.toLowerCase()=="radians")
89
-            unitMode=2;
90
-
91
-    }
92
-    public void switchUnitsMode(){
93
-        if (unitMode==2){
94
-            unitMode=1;
95
-            // call update display
96
-        } 
97
-        else {
98
-            unitMode++;
99
-            // call update display
100
-        }
101
-
102
-    }
103
-
104
-}

+ 0
- 45
UpdateDisplay.java Прегледај датотеку

@@ -1,45 +0,0 @@
1
-
2
-/**
3
- * Write a description of class UpdateDisplay here.
4
- *
5
- * @author (your name)
6
- * @version (a version number or a date)
7
- */
8
-public class UpdateDisplay
9
-{
10
-    // instance variables - replace the example below with your own
11
-    private int x;
12
-
13
-    /**
14
-     * Constructor for objects of class UpdateDisplay
15
-     */
16
-    public UpdateDisplay(Double displayNumber)
17
-    {
18
-       
19
-        // initialise instance variables
20
-        //x = 0;
21
-    }
22
-
23
-    /**
24
-     * An example of a method - replace this comment with your own
25
-     *
26
-     * @param  y  a sample parameter for a method
27
-     * @return    the sum of x and y
28
-     */
29
-    
30
-    SwitchModes sm = new SwitchModes();
31
-    
32
-    public String UpdateDisplay(Double displayNumber)
33
-    {
34
-     String str="";
35
-     
36
-     
37
-     // update number system based on display mode variable (see SwitchModes class)
38
-     
39
-     
40
-     
41
-     return str;   
42
-    }
43
-}
44
-
45
-

+ 0
- 1
demo.txt Прегледај датотеку

@@ -1 +0,0 @@
1
-Demo file