Skip to content

Commit 9268ccd

Browse files
committed
Add lines of code counting function
1 parent b60e0db commit 9268ccd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/Project Tracker/Project Tracker/Statistics.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34
using System.Linq;
45
using System.Text;
56
using System.Threading.Tasks;
67

78
namespace Project_Tracker {
89
class Statistics {
910
public static int CountLines(string[] files) {
11+
int linesOfCode = 0;
1012

11-
return -1;
13+
foreach (string file in files) {
14+
linesOfCode += File.ReadLines(file).Count();
15+
}
16+
17+
return linesOfCode;
1218
}
1319

1420

0 commit comments

Comments
 (0)