diff --git a/pom.xml b/pom.xml index 9901415..53d9e98 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,26 @@ io.zipcoder project-2-atm 1.0-SNAPSHOT + + + + org.apache.maven.plugins + maven-compiler-plugin + + 6 + 6 + + + + + + + junit + junit + 4.12 + test + + \ No newline at end of file diff --git a/src/main/java/Account.java b/src/main/java/Account.java new file mode 100644 index 0000000..cb25356 --- /dev/null +++ b/src/main/java/Account.java @@ -0,0 +1,49 @@ +public class Account { + + private Double checkingBalance; + private Double savingBalance; + private Double investBalance; + + + public Account(){ + + + } + + + public Double getCheckingBalance() { + return checkingBalance; + } + + public void depositChecking(Double deposit) { + this.checkingBalance += deposit; + } + + public void withdrawChecking(Double withdraw) { + this.checkingBalance -= withdraw; + } + + public Double getSavingBalance() { + return savingBalance; + } + + public void depositSaving(Double deposit) { + this.savingBalance += deposit; + } + + public void withdrawSaving(Double withdraw) { + this.savingBalance -= withdraw; + } + + public Double getInvestBalance() { + return investBalance; + } + + public void depositInvest(Double deposit) { + this.investBalance += deposit; + } + + public void withdrawInvest(Double withdraw) { + this.investBalance -= withdraw; + } +} diff --git a/src/main/java/AccountActions.java b/src/main/java/AccountActions.java new file mode 100644 index 0000000..91ee077 --- /dev/null +++ b/src/main/java/AccountActions.java @@ -0,0 +1,4 @@ +public class AccountActions { + + +} diff --git a/src/main/java/Console.java b/src/main/java/Console.java new file mode 100644 index 0000000..d20fabc --- /dev/null +++ b/src/main/java/Console.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class Console extends Interface { + + public static void print(String output, Object... args) { + System.out.printf(output, args); + } + + public static void println(String output, Object... args) { + print(output + "\n", args); + } + + public static String getStringInput(String prompt) { + Scanner scanner = new Scanner(System.in); + println(prompt); + String userInput = scanner.nextLine(); + return userInput; + } + + public static Integer getIntegerInput(String prompt) { + Scanner scanner = new Scanner(System.in); + println(prompt); + Integer userInput = Integer.valueOf(scanner.nextLine()); + return userInput; + } + + + public static Double getDoubleInput(String prompt) { + Scanner scanner = new Scanner(System.in); + println(prompt); + Double userInput = Double.valueOf(scanner.nextLine()); + return userInput; + } + +} diff --git a/src/main/java/CreateAccount.java b/src/main/java/CreateAccount.java new file mode 100644 index 0000000..543bf1a --- /dev/null +++ b/src/main/java/CreateAccount.java @@ -0,0 +1,3 @@ +public class CreateAccount { + +} diff --git a/src/main/java/Interface.java b/src/main/java/Interface.java new file mode 100644 index 0000000..8921464 --- /dev/null +++ b/src/main/java/Interface.java @@ -0,0 +1,43 @@ + + +public class Interface { + + Account account = new Account(); + CreateAccount newAccount = new CreateAccount(); + //LogIn logIn = new LogIn(); + AccountActions accountActions = new AccountActions(); + + + public void atmApp() { + Integer choice; + + do { + + Console.println("Please type one of the following options:\n" + + "1 = Log in to Account.\n" + + "2 = Create new Account.\n" + + "3 = Exit ATM.\n"); + + choice = Console.getIntegerInput("Enter the choice you would like to make.\n"); + + switch (choice) { + + + // LogIn Code + case 1: + break; + + + // Creating new Account Code + case 2: + break; + + + case 3: + Console.println("SHUTTING DOOOWWNNNNNN!!!!!!"); + break; + } + } while (choice != 3); + + } +} diff --git a/src/main/java/Main.java b/src/main/java/Main.java deleted file mode 100644 index 05e41a9..0000000 --- a/src/main/java/Main.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Created by iyasuwatts on 10/17/17. - */ -public class Main { - - public static void main(String[] args){ - - } -} diff --git a/src/main/java/User.java b/src/main/java/User.java new file mode 100644 index 0000000..9337c6b --- /dev/null +++ b/src/main/java/User.java @@ -0,0 +1,59 @@ +import java.util.ArrayList; + +public class User { + + private int id = 0; + private String username; + private String password; + protected static ArrayList accounts = new ArrayList(); + + + + public User(String username, String password) { + this.username = username; + this.password = password; + this.id = id; + id++; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getUserName() { + return username; + } + + public void setUserName(String userName) { + this.username = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + + } + + public static ArrayList getAccounts() { + return accounts; + } + + public static void setAccounts(ArrayList accounts) { + User.accounts = accounts; + } + + @Override + public String toString() { + return "Username: " + this.getUserName() + + "\nPassword: " + this.getPassword() + + "\nId: " + this.getId(); + } + +} diff --git a/src/main/java/UserCreator.java b/src/main/java/UserCreator.java new file mode 100644 index 0000000..0bcf2fc --- /dev/null +++ b/src/main/java/UserCreator.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class UserCreator { + + public UserCreator(){ + + } + + public static User createUser() { + + String username = setUsername(); + String password = setPassword(); + + + User newUser = new User(username, password); + UserHolder.addUser(newUser); + + return newUser; + } + + public static String setUsername() { + String username; + Scanner input = new Scanner(System.in); + System.out.println("Create a Username: "); + username = input.next(); + return username; + + } + + public static String setPassword() { + String password; + Scanner input = new Scanner(System.in); + System.out.println("Create a password: "); + password = input.nextLine(); + return password; + } + +} diff --git a/src/main/java/UserHolder.java b/src/main/java/UserHolder.java new file mode 100644 index 0000000..43ce8e4 --- /dev/null +++ b/src/main/java/UserHolder.java @@ -0,0 +1,17 @@ +import java.util.ArrayList; + +public class UserHolder { + + static final ArrayList users = new ArrayList(); + + public static void addUser(User newUser) { + System.out.println("Your username and password is created\n"); + users.add(newUser); + + } + + + public static ArrayList getList() { + return users; + } +}