0
1
00:00:00,221 --> 00:00:07,361
Alright so here I'm going to
give you a specification for a
1

2
00:00:07,361 --> 00:00:10,321
typescript class that I want
you to create that will be a
2

3
00:00:10,321 --> 00:00:14,081
bank account okay and so there
are several operations that I
3

4
00:00:14,081 --> 00:00:18,241
want you to implement in this
bank account class so here they
4

5
00:00:18,241 --> 00:00:23,361
are. So first of all we will
work on the basic operations so
5

6
00:00:23,361 --> 00:00:26,321
you have to be able to add
money to bank account to
6

7
00:00:26,321 --> 00:00:30,041
withdraw money from the bank
account and to get the current
7

8
00:00:30,041 --> 00:00:34,281
balance so this should be
pretty simple then be careful
8

9
00:00:34,281 --> 00:00:37,481
you will have to also check the
minimum balance okay so you
9

10
00:00:37,481 --> 00:00:39,881
will have to ensure that the
funds are sufficient to
10

11
00:00:39,881 --> 00:00:43,161
withdraw otherwise you will
have to throw an error so if
11

12
00:00:43,161 --> 00:00:46,281
the savings are under zero you
will have to throw an error
12

13
00:00:46,281 --> 00:00:50,601
then this one is a bit
complicated we will have
13

14
00:00:50,601 --> 00:00:55,321
mensual interests so an
account as a percent of
14

15
00:00:55,321 --> 00:01:01,081
menstrual interests and we
should be able to get at any
15

16
00:01:01,081 --> 00:01:05,161
time the amount of mensual
interest okay so basically we
16

17
00:01:05,161 --> 00:01:07,881
should be able to define a
percent of interest for example
17

18
00:01:07,881 --> 00:01:13,801
1% for one account and so for
example if there is $1, 000 on
18

19
00:01:13,801 --> 00:01:17,641
the account then the menstrual
interest should be $10 okay 1%
19

20
00:01:17,641 --> 00:01:22,361
of 1000 you don't have to
modify the current balance or
20

21
00:01:22,361 --> 00:01:25,961
savings okay we just want that
to know what the mensual
21

22
00:01:25,961 --> 00:01:29,721
interest are okay it shouldn't
modify anything okay we just
22

23
00:01:29,721 --> 00:01:35,801
want to be able to calculate
them. Then there is a ceiling,
23

24
00:01:35,801 --> 00:01:39,641
a limit on the mensual
interest that you can earn. So
24

25
00:01:39,641 --> 00:01:42,921
for example, you should be able
to set the limit. So for
25

26
00:01:42,921 --> 00:01:48,041
example, let's say $50, 000,
okay? So for example, if the
26

27
00:01:48,041 --> 00:01:52,321
interested are calculated on
this maximum of 50thousand
27

28
00:01:52,321 --> 00:01:55,921
dollars, then it means that if
you have, for example, $52,
28

29
00:01:55,921 --> 00:02:03,241
000, you'll still have only 1%
of 50000 as mensual interest.
29

30
00:02:03,241 --> 00:02:07,001
So 50000 will be the limit
okay? Uh otherwise if you are a
30

31
00:02:07,001 --> 00:02:10,521
billionaire then 1% of
one billion would be a lot so
31

32
00:02:10,521 --> 00:02:13,241
the bank doesn't want that
okay. They don't want you to
32

33
00:02:13,241 --> 00:02:17,961
earn too much money. And
finally you should be able to
33

34
00:02:17,961 --> 00:02:21,081
manage your favourite accounts.
Meaning that you should be able
34

35
00:02:21,081 --> 00:02:23,961
to access the list of your
favourite accounts from one
35

36
00:02:23,961 --> 00:02:28,361
account. So one account as a
list of favourite accounts and
36

37
00:02:28,361 --> 00:02:32,221
we can add an account into the
list. And we should be able
37

38
00:02:32,221 --> 00:02:37,501
remove an account from the list
using its ID okay so as you can
38

39
00:02:37,501 --> 00:02:41,501
see there is quite some work to
do once you will have
39

40
00:02:41,501 --> 00:02:45,981
completely build your bank
account class, then we will write
40

41
00:02:45,981 --> 00:02:49,501
a story okay and here is the
story that you will have to
41

42
00:02:49,501 --> 00:02:55,341
write you will have to create
two bank accounts a bank
42

43
00:02:55,341 --> 00:03:00,941
account one and a bank account
2,  1 with $40, 000 in the bank
43

44
00:03:00,941 --> 00:03:04,981
account one and one with $100,
000 in the bank account two
44

45
00:03:04,981 --> 00:03:09,521
then you set 1% of mensual
interest for each of this
45

46
00:03:09,521 --> 00:03:14,161
account okay and you will set
an interest ceiling of $50, 000
46

47
00:03:14,161 --> 00:03:17,761
for each of this account okay
so they they will have the same
47

48
00:03:17,761 --> 00:03:25,201
data except the initial savings
okay the initial balance then
48

49
00:03:25,201 --> 00:03:27,921
you will add the bank account
to to bank account one
49

50
00:03:27,921 --> 00:03:32,321
favorites then you will
transfer $20, 000 from bank
50

51
00:03:32,321 --> 00:03:35,681
account one to its first
favorite bank account so
51

52
00:03:35,681 --> 00:03:37,981
technically should have only
one bank account in its
52

53
00:03:37,981 --> 00:03:42,721
favorite and you should target
the first one in this list.
53

54
00:03:42,721 --> 00:03:45,841
Then you will withdraw 25000 dollar from bank account
54

55
00:03:45,841 --> 00:03:50,321
one and you will catch the
error if there is one. Then you
55

56
00:03:50,321 --> 00:03:53,441
will display the amount of
mensual interest on bank
56

57
00:03:53,441 --> 00:03:57,521
account one. Then you will
display the balance of bank
57

58
00:03:57,521 --> 00:04:00,241
account one and finally you
will remove the bank account
58

59
00:04:00,241 --> 00:04:04,961
two from bank account one
favourites. Okay? And I
59

60
00:04:04,961 --> 00:04:07,881
actually don't think I said
that but in the basic
60

61
00:04:07,881 --> 00:04:14,661
operations here I'm going to
add one you should be able to
61

62
00:04:14,661 --> 00:04:20,461
transfer money to another
account.
62

63
00:04:22,221 --> 00:04:26,881
So obviously I'm going to share
that with you so you can use it
63

64
00:04:26,881 --> 00:04:31,281
while building your bank
account and your story so try
64

65
00:04:31,281 --> 00:04:34,801
your best it's alright if you
kind of do it but try to type
65

66
00:04:34,801 --> 00:04:39,281
everything as much as you can
try to make sure that
66

67
00:04:39,281 --> 00:04:43,201
everything is safe and you
handle all the errors and yeah
67

68
00:04:43,201 --> 00:04:47,121
good luck and see you in the
next one
