-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSurvey.cs
71 lines (61 loc) · 2.01 KB
/
Survey.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Net.NetworkInformation;
namespace LinkedIn_Learning_C_Sharp
{
class Survey
{
class Answer
{
public string Name;
public int Age;
public string BirthMonth;
public void Display()
{
Console.WriteLine("Thank you for your information " + Name + ".");
Console.WriteLine("You are " + Age + " years old. You were born in " + BirthMonth + " (great month).");
if (BirthMonth == "December")
{
Console.WriteLine("You are a Sagittarius.");
}
else if (BirthMonth == "April")
{
Console.WriteLine("You are a Taurus.");
}
else if (BirthMonth == "May")
{
Console.WriteLine("You are a Gemini.");
}
}
}
static public event Action Posted;
/*static void Main(string[] args)
{
var stats = new Stats();
stats.Start();
var answerList = new List<Answer>();
var newAnswer = new Answer();
Console.WriteLine("What is your name?");
newAnswer.Name = TryAnswer();
Console.WriteLine("How old are you? (# only please!)");
newAnswer.Age = int.Parse(TryAnswer());
Console.WriteLine("What month were you born?");
newAnswer.BirthMonth = TryAnswer();
if (Posted != null)
{
Posted();
}
newAnswer.Display();
}*/
static string TryAnswer()
{
var answer = Console.ReadLine();
if (answer == "")
{
Console.WriteLine("You didn't type anything...");
return Console.ReadLine();
}
return answer;
}
}
}