1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import java.util.Scanner;
-
- /**
- * Created by leon on 2/9/18.
- */
- public class Console {
- public String userInput2;
- double currentValue;
- double memory;
-
-
- public Console() {
-
- }
-
- public double getCurrentValue() {
- return currentValue;
- }
-
- public double clearCurrentValue() {
- return currentValue = 0;
- }
-
- public double changeCurrentValue(double b) {
-
- return currentValue = b;
- }
-
- public double mPlus(double value){
-
-
- return memory += value;
- }
-
- public double mClear(){
-
-
- return memory = 0;
- }
-
- public double mRc(){
-
- return changeCurrentValue(memory);
- }
-
-
- public void print(String output, Object... args) {
- System.out.printf(output, args);
- }
-
- public void println(String output, Object... args) {
- print(output + "\n", args);
- }
-
- public String getStringInput(String prompt) {
- Scanner scanner = new Scanner(System.in);
- println(prompt);
- String userInput = scanner.nextLine();
- String userInput2 = userInput.toLowerCase();
- return userInput2;
- }
-
- /*public static Integer getIntegerInput(String prompt) {
- return null;
- }*/
-
- public Double getDoubleInput(String prompt) {
- Scanner scannerB = new Scanner(System.in);
- double b = 0;
- println(prompt);
- if(scannerB.hasNextDouble()){
- b = scannerB.nextDouble();
- }else{
- System.out.print("Invalid input please start over\n");
- }
- return b;
- }
- }
-
|