Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
<groupId>io.zipcoder</groupId>
<artifactId>project-2-atm</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>6</source>
<target>6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
49 changes: 49 additions & 0 deletions src/main/java/Account.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
4 changes: 4 additions & 0 deletions src/main/java/AccountActions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public class AccountActions {


}
35 changes: 35 additions & 0 deletions src/main/java/Console.java
Original file line number Diff line number Diff line change
@@ -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;
}

}
3 changes: 3 additions & 0 deletions src/main/java/CreateAccount.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public class CreateAccount {

}
43 changes: 43 additions & 0 deletions src/main/java/Interface.java
Original file line number Diff line number Diff line change
@@ -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);

}
}
9 changes: 0 additions & 9 deletions src/main/java/Main.java

This file was deleted.

59 changes: 59 additions & 0 deletions src/main/java/User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import java.util.ArrayList;

public class User {

private int id = 0;
private String username;
private String password;
protected static ArrayList<Account> accounts = new ArrayList<Account>();



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<Account> getAccounts() {
return accounts;
}

public static void setAccounts(ArrayList<Account> accounts) {
User.accounts = accounts;
}

@Override
public String toString() {
return "Username: " + this.getUserName() +
"\nPassword: " + this.getPassword() +
"\nId: " + this.getId();
}

}
38 changes: 38 additions & 0 deletions src/main/java/UserCreator.java
Original file line number Diff line number Diff line change
@@ -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;
}

}
17 changes: 17 additions & 0 deletions src/main/java/UserHolder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import java.util.ArrayList;

public class UserHolder {

static final ArrayList<User> 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<User> getList() {
return users;
}
}