Skip to content

Commit 92d6c3c

Browse files
donald fdonald f
authored andcommitted
i have no clue what I am doing :-(
1 parent 9d552c3 commit 92d6c3c

File tree

12 files changed

+424
-1
lines changed

12 files changed

+424
-1
lines changed

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77
<groupId>io.zipcoder</groupId>
88
<artifactId>project-2-atm</artifactId>
99
<version>1.0-SNAPSHOT</version>
10+
<build>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.apache.maven.plugins</groupId>
14+
<artifactId>maven-compiler-plugin</artifactId>
15+
<configuration>
16+
<source>1.7</source>
17+
<target>1.7</target>
18+
</configuration>
19+
</plugin>
20+
</plugins>
21+
</build>
1022

1123

1224
</project>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package t.ATMFunctions;
2+
3+
import t.Accounts.Console;
4+
5+
public class ATM {
6+
7+
public void start() {
8+
9+
System.out.println("Welcome to Zip Code Wilmington Federal Credit Union.\n");
10+
int userInput = Console.getIntInput("If you have an account please input '1' if you do not have an account please input '2'.");
11+
boolean terminator = false;
12+
13+
while(terminator!=false) {
14+
switch (userInput) {
15+
case 1:
16+
//call login method
17+
break;
18+
case 2:
19+
//call create new user method from user factory
20+
break;
21+
default:
22+
System.out.println("Please enter a correct response.\n");
23+
userInput = Console.getIntInput("If you have an account please input '1' if you do not have an account please input '2'.");
24+
continue;
25+
}
26+
terminator = false;
27+
}
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
/*System.out.println("Welcome to the ATM Machine.\n");
39+
System.out.println("From here you have several options.");
40+
printOptions();
41+
String userInput = Terminal.getStringInput("Enter the command that you would like to execute.");
42+
switch (userInput) {
43+
case "WITHDRAW":
44+
Withdraw withdraw = new Withdraw();
45+
break;
46+
47+
case "DEPOSIT":
48+
break;
49+
50+
case "TRANSFER":
51+
break;
52+
53+
case "OPEN NEW ACCOUNT":
54+
break;
55+
56+
case "CLOSER ACCOUNT":
57+
break;
58+
59+
case "PRINT TRANSACTION HISTORY":
60+
break;
61+
62+
case "CHECK BALANCE":
63+
break;
64+
65+
default:
66+
System.out.println("Please enter an appropriate command.");
67+
break;
68+
}
69+
}
70+
71+
private void printOptions() {
72+
System.out.println("WITHDRAW\nDEPOSIT\nTRANSFER\nOPEN NEW ACCOUNT\nCLOSE ACCOUNT\nPRINT TRANSACTION HISTORY\nCHECK BALANCE\n");*/
73+
74+
75+
}
76+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package t.ATMFunctions;
2+
3+
import java.util.Scanner;
4+
5+
public class Console {
6+
public static String getStringInput(String promptUser) {
7+
Scanner string = new Scanner(System.in);
8+
System.out.println(promptUser);
9+
String userInput = string.nextLine();
10+
return userInput;}
11+
12+
public static int getIntInput(String askUser) {
13+
Scanner integer = new Scanner(System.in);
14+
System.out.println(askUser);
15+
int Input = integer.nextInt();
16+
return Input;
17+
}
18+
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
package t.ATMFunctions;
2+
13
/**
24
* Created by iyasuwatts on 10/17/17.
35
*/
46
public class Main {
57

68
public static void main(String[] args){
7-
9+
ATM atmTransaction = new ATM();
10+
atmTransaction.start();
811
}
912
}
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
package t.Accounts;
2+
3+
import t.ATMFunctions.Console;
4+
5+
6+
public abstract class Accounts {
7+
8+
private String createAccount() {
9+
10+
int userInput = Console.getIntInput("Please input what type of account you'd like to create.\n" +
11+
"Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
12+
13+
boolean terminator = false;
14+
15+
while (terminator = true) {
16+
switch (userInput) {
17+
case 1:
18+
//create a checking account
19+
break;
20+
case 2:
21+
//create a savings account
22+
break;
23+
case 3:
24+
//create an investment account
25+
default:
26+
System.out.println("Please enter a correct response.\n");
27+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
28+
continue;
29+
}
30+
terminator = false;
31+
}
32+
return ""; //what type of account they created
33+
}
34+
35+
private String deleteAccount() {
36+
int userInput = Console.getIntInput("Please input what type of account you'd like to delete.\n" +
37+
"Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
38+
39+
boolean terminator = false;
40+
41+
while (terminator = true) {
42+
switch (userInput) {
43+
case 1:
44+
//delete a checking account
45+
break;
46+
case 2:
47+
//delete a savings account
48+
break;
49+
case 3:
50+
//delete an investment account
51+
default:
52+
System.out.println("Please enter a correct response.\n");
53+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
54+
continue;
55+
}
56+
terminator = false;
57+
}
58+
return "";//what account they just delete
59+
}
60+
61+
private String viewAccount() {
62+
int userInput = Console.getIntInput("Please input what type of account you'd like to view.\n" +
63+
"Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
64+
65+
boolean terminator = false;
66+
67+
while (terminator = true) {
68+
switch (userInput) {
69+
case 1:
70+
//view a checking account
71+
break;
72+
case 2:
73+
//view a savings account
74+
break;
75+
case 3:
76+
//view an investment account
77+
default:
78+
System.out.println("Please enter a correct response.\n");
79+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
80+
continue;
81+
}
82+
terminator = false;
83+
}
84+
return "";//the info for the account they chose to view
85+
}
86+
87+
private void transferBetweenAccounts() {
88+
int userInput = Console.getIntInput("Please input which accounts that you'd like to transfer money between.\n" +
89+
"Please indicate what account you'd like to transfer FROM by\n" +
90+
" entering '1' for checking account, entering '2' for savings account and entering'3' for an investment account.");
91+
92+
boolean terminator = false;
93+
94+
while (terminator = true) {
95+
switch (userInput) {
96+
case 1:
97+
//view checking account balance
98+
break;
99+
case 2:
100+
//view savings account balance
101+
break;
102+
case 3:
103+
//view investment account balance
104+
default:
105+
System.out.println("Please enter a correct response.\n");
106+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
107+
continue;
108+
}
109+
terminator = false;
110+
}
111+
112+
userInput += Console.getIntInput("Please indicate what account you'd like to transfer TO by\n" +
113+
" entering '1' for checking account, entering '2' for savings account and entering'3' for an investment account.");
114+
115+
while (terminator = true) {
116+
switch (userInput) {
117+
case 1:
118+
//view checking account balance
119+
break;
120+
case 2:
121+
//view savings account balance
122+
break;
123+
case 3:
124+
//view investment account balance
125+
default:
126+
System.out.println("Please enter a correct response.\n");
127+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
128+
continue;
129+
}
130+
terminator = false;
131+
132+
//call view method to show user account information for both accounts
133+
134+
int amountToTransfer = Console.getIntInput("How much money would you like to transfer between accounts?");
135+
136+
//transfer the desired amount between specified accounts
137+
138+
}
139+
}
140+
private String depositMoney(){
141+
142+
int userInput = Console.getIntInput("Please indicate which account you'd like to deposit money into.\n" +
143+
"Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
144+
145+
boolean terminator = false;
146+
147+
while (terminator = true) {
148+
switch (userInput) {
149+
case 1:
150+
//view checking account balance
151+
break;
152+
case 2:
153+
//view savings account nalance
154+
break;
155+
case 3:
156+
//view investment account balance
157+
default:
158+
System.out.println("Please enter a correct response.\n");
159+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
160+
continue;
161+
}
162+
terminator = false;
163+
164+
int amountToDeposit = Console.getIntInput("How much money would you like to deposit?");
165+
166+
//call method to deposit indicated amount into indicated account
167+
}
168+
return "";//new account balance
169+
}
170+
171+
private String withDrawMoney(){
172+
173+
int userInput = Console.getIntInput("Please indicate which account you'd like to withdraw money from.\n" +
174+
"Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
175+
176+
boolean terminator = false;
177+
178+
while (terminator = true) {
179+
switch (userInput) {
180+
case 1:
181+
//view checking account balance
182+
break;
183+
case 2:
184+
//view savings account nalance
185+
break;
186+
case 3:
187+
//view investment account balance
188+
default:
189+
System.out.println("Please enter a correct response.\n");
190+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
191+
continue;
192+
}
193+
terminator = false;
194+
195+
int amountToDeposit = Console.getIntInput("How much money would you like to withdraw?\n" +
196+
"All withdraw requests must be in $20 and no more than $600.");
197+
198+
//call method to withdraw indicated amount from indicated account
199+
}
200+
return "";//new account balance
201+
}
202+
203+
private void interestedAccrued() {
204+
205+
int userInput = Console.getIntInput("Please indicate which account you'd like to view accrued interest.\n" +
206+
"Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
207+
208+
boolean terminator = false;
209+
210+
while (terminator = true) {
211+
switch (userInput) {
212+
case 1:
213+
//view checking account interest
214+
break;
215+
case 2:
216+
//view savings account interest
217+
break;
218+
case 3:
219+
//view investment account insterest
220+
default:
221+
System.out.println("Please enter a correct response.\n");
222+
userInput = Console.getIntInput("Please enter '1' for checking account, enter '2' for savings account and enter'3' for an investment account.");
223+
continue;
224+
}
225+
terminator = false;
226+
227+
}
228+
}
229+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package t.Accounts;
2+
3+
import t.Accounts.Accounts;
4+
5+
public class Checking extends Accounts {
6+
7+
8+
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package t.Accounts;
2+
3+
import t.Accounts.Accounts;
4+
5+
public class Investment extends Accounts {
6+
7+
8+
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package t.Accounts;
2+
3+
import t.Accounts.Accounts;
4+
5+
public class Saving extends Accounts {
6+
7+
8+
9+
}

src/main/java/t/Tests/ATMTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package t.Tests;
2+
3+
4+
public class ATMTest {
5+
}

0 commit comments

Comments
 (0)