Skip to content

Commit f52289e

Browse files
committed
clean up code files a bit
1 parent aef3767 commit f52289e

File tree

14 files changed

+6
-622
lines changed

14 files changed

+6
-622
lines changed

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M1/Solution/BankAccount.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Classes_M1;
44

5+
// Task 1
6+
// Task 2
57
// Task 3
68

79
/*
@@ -136,10 +138,6 @@ public BankAccount(string customerIdNumber, double balance, string accountType)
136138

137139

138140

139-
140-
141-
142-
143141
// Task 4
144142

145143

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M1/Solution/BankCustomer.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,5 @@ public BankCustomer(string firstName, string lastName)
114114

115115

116116

117-
118-
119-
120117
// Task 4
121118

122-
123-
124-
125-

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M1/Solution/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,3 @@
9090
Console.WriteLine($"Account 2: Account # {account2.accountNumber}, type {account2.accountType}, balance {account2.balance}, rate {BankAccount.interestRate}, customer ID {account2.customerId}");
9191
Console.WriteLine($"Account 3: Account # {account3.accountNumber}, type {account3.accountType}, balance {account3.balance}, rate {BankAccount.interestRate}, customer ID {account3.customerId}");
9292

93-
94-
95-
// Task 4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
There is no starter code for this exercise.
1+
NOTE: There is no starter code for this exercise.

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M2/Solution/BankAccount.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public BankAccount(string customerIdNumber, double balance, string accountType)
3939

4040

4141

42-
4342
// Task 2
4443

4544
// Code isn't updated in task 2
4645

4746

47+
4848
// Task 3
4949
/*
5050
public class BankAccount
@@ -195,4 +195,4 @@ public void ApplyInterest()
195195
{
196196
Balance += Balance * interestRate;
197197
}
198-
}
198+
}

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M2/Solution/BankCustomer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,3 @@ public override int GetHashCode()
180180
return customerId.GetHashCode();
181181
}
182182
}
183-

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M2/Solution/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ public static bool CanWithdraw(this BankAccount account, double amount)
3131
return account.Balance >= amount;
3232
}
3333
}
34-
}
34+
}

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M2/Solution/Program.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,12 @@
7474
// Task 3
7575

7676

77-
78-
7977
// Task 4
8078

8179

8280
// Task 5
8381

8482

85-
86-
8783
// Task 6
8884

8985

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M2/Starter/BankAccount.cs

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,105 +2,6 @@
22

33
namespace Classes_M1;
44

5-
// Task 3
6-
7-
/*
8-
9-
// Create a BankAccount class that includes static members for the next account number and the interest rate.
10-
11-
public class BankAccount
12-
{
13-
private static int nextAccountNumber = 1;
14-
public int accountNumber;
15-
public double balance = 0;
16-
public static double interestRate = 0;
17-
public string accountType = "Checking";
18-
19-
20-
21-
public BankAccount()
22-
{
23-
this.accountNumber = nextAccountNumber++;
24-
Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}");
25-
}
26-
27-
public BankAccount(double balance, string accountType)
28-
{
29-
this.accountNumber = nextAccountNumber++;
30-
this.balance = balance;
31-
this.accountType = accountType;
32-
Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}");
33-
}
34-
}
35-
36-
*/
37-
38-
39-
/*
40-
// Create a BankAccount class that includes static members for the next account number and the interest rate, and makes the account number read-only.
41-
public class BankAccount
42-
{
43-
private static int nextAccountNumber = 1;
44-
public readonly int accountNumber;
45-
public double balance = 0;
46-
public static double interestRate = 0;
47-
public string accountType = "Checking";
48-
49-
public BankAccount()
50-
{
51-
this.accountNumber = nextAccountNumber++;
52-
Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}");
53-
}
54-
55-
public BankAccount(double balance, string accountType)
56-
{
57-
this.accountNumber = nextAccountNumber++;
58-
this.balance = balance;
59-
this.accountType = accountType;
60-
Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}");
61-
}
62-
}
63-
64-
65-
*/
66-
67-
68-
/*
69-
// Create a BankAccount class that includes static members for the next account number and the interest rate, makes the account number
70-
// read-only, and uses a static constructor to initialize the next account number and interest rate.
71-
public class BankAccount
72-
{
73-
private static int nextAccountNumber;
74-
public readonly int accountNumber;
75-
public double balance = 0;
76-
public static double interestRate;
77-
public string accountType = "Checking";
78-
79-
static BankAccount()
80-
{
81-
Random random = new Random();
82-
nextAccountNumber = random.Next(10000000, 20000000);
83-
interestRate = 0;
84-
}
85-
86-
public BankAccount()
87-
{
88-
this.accountNumber = nextAccountNumber++;
89-
Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}");
90-
}
91-
92-
public BankAccount(double balance, string accountType)
93-
{
94-
this.accountNumber = nextAccountNumber++;
95-
this.balance = balance;
96-
this.accountType = accountType;
97-
Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}");
98-
}
99-
}
100-
101-
*/
102-
103-
1045
public class BankAccount
1056
{
1067
private static int nextAccountNumber;
@@ -133,15 +34,3 @@ public BankAccount(string customerIdNumber, double balance, string accountType)
13334
//Console.WriteLine($"Account created: account# {accountNumber}, balance {balance}, rate {interestRate}, type {accountType}, customer ID {customerId}");
13435
}
13536
}
136-
137-
138-
139-
140-
141-
142-
143-
// Task 4
144-
145-
146-
147-

DownloadableCodeProjects/LP1_classes-properties-methods/Classes_M2/Starter/BankCustomer.cs

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -2,94 +2,6 @@
22

33
namespace Classes_M1;
44

5-
/*
6-
//Task 1
7-
8-
public class BankCustomer
9-
{
10-
public BankCustomer()
11-
{
12-
Console.WriteLine("BankCustomer created");
13-
}
14-
15-
public BankCustomer(string firstName, string lastName)
16-
{
17-
Console.WriteLine($"BankCustomer created: {firstName} {lastName}");
18-
}
19-
}
20-
21-
*/
22-
23-
24-
25-
// Task 2
26-
27-
/*
28-
public class BankCustomer
29-
{
30-
// add public fields for fName, lName, and accountID
31-
public string fName = "John";
32-
public string lName = "Doe";
33-
public string customerId = "1010101010";
34-
35-
public BankCustomer()
36-
{
37-
Console.WriteLine($"BankCustomer created: {fName} {lName} {customerId}");
38-
}
39-
40-
public BankCustomer(string firstName, string lastName)
41-
{
42-
fName = firstName;
43-
lName = lastName;
44-
45-
Console.WriteLine($"BankCustomer created: {fName} {lName} {customerId}");
46-
}
47-
48-
public BankCustomer(string firstName, string lastName, string customerIdNumber)
49-
{
50-
fName = firstName;
51-
lName = lastName;
52-
customerId = customerIdNumber;
53-
54-
Console.WriteLine($"BankCustomer created: {fName} {lName} {customerId}");
55-
}
56-
}
57-
58-
*/
59-
60-
/*
61-
public class BankCustomer
62-
{
63-
// add public fields for fName, lName, and accountID
64-
public string fName = "John";
65-
public string lName = "Doe";
66-
public string customerId = "1010101010";
67-
68-
public BankCustomer()
69-
{
70-
71-
}
72-
73-
public BankCustomer(string firstName, string lastName)
74-
{
75-
fName = firstName;
76-
lName = lastName;
77-
78-
}
79-
80-
public BankCustomer(string firstName, string lastName, string customerIdNumber)
81-
{
82-
fName = firstName;
83-
lName = lastName;
84-
customerId = customerIdNumber;
85-
}
86-
}
87-
88-
*/
89-
90-
91-
// Task 3
92-
935
public class BankCustomer
946
{
957
private static int nextCustomerId;
@@ -111,15 +23,3 @@ public BankCustomer(string firstName, string lastName)
11123
}
11224

11325
}
114-
115-
116-
117-
118-
119-
120-
// Task 4
121-
122-
123-
124-
125-

0 commit comments

Comments
 (0)