forked from EllieJudge/c_sharp_coding_exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise001.cs
More file actions
51 lines (46 loc) · 1.53 KB
/
Exercise001.cs
File metadata and controls
51 lines (46 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
namespace TechReturners.Exercises
{
public class Exercise001
{
public static String CapitalizeWord(String word)
{
return word.Substring(0, 1).ToUpper() + word.Substring(1);
throw new NotImplementedException();
}
public static String GenerateInitials(String firstName, String lastName)
{
return firstName.Substring(0, 1).ToUpper() + "." + lastName.Substring(0, 1).ToUpper();
throw new NotImplementedException();
}
public static double AddVat(double originalPrice, double vatRate)
{
return Math.Round((originalPrice + (originalPrice * (vatRate / 100))), 2);
throw new NotImplementedException();
}
public static String Reverse(String sentence)
{
string newsentence = "";
for (int i = sentence.Length-1; i >= 0; i--)
{
newsentence = newsentence + sentence.Substring(i, 1);
}
return newsentence;
throw new NotImplementedException();
}
public static int CountLinuxUsers(List<User> users)
{
int count = 0;
foreach(User user in users)
{
if(user.Type == "Linux")
{
count++;
}
}
return count;
throw new NotImplementedException();
}
}
}