-
Notifications
You must be signed in to change notification settings - Fork 14
/
stage_0_Margaret.cs
37 lines (30 loc) · 1.04 KB
/
stage_0_Margaret.cs
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
using System;
namespace Hello
{
class Program
{
static void Main(string[] args)
{
var myself = new
{
name = "Margaret Chifwete",
email = "[email protected]",
slackUsername = "@margaret",
twitterUsername = "@marg1234",
BioStack = "Genomics"
};
Console.WriteLine(myself.name + "\n" + myself.email
+ "\n" + myself.slackUsername + "\n" + myself.twitterUsername + "\n" + myself.bioStack);
Console.WriteLine("Hamming_distance: " + computeHammingDistance(myself.slackUsername, myself.twitterUsername));
}
private static int computeHammingDistance(string slack, string twitter) {
int distance = 0;
for (int i = 0; i < slack.Length; i++) {
if (slack.ToLower()[i] != twitter.ToLower()[i]) {
distance++;
}
}
return distance;
}
}
}