-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
104 lines (93 loc) · 3.22 KB
/
Program.cs
File metadata and controls
104 lines (93 loc) · 3.22 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _99_WhiteBoardAssessment
{
class Program
{
static void Main(string[] args)
{
PlaceForMethods methods = new PlaceForMethods();
// Challenge 1
int apples = 23;
string oranges = "Oranges!";
DateTime picked = new DateTime(2020, 7,1);
// Challenge 2 used
Console.WriteLine(methods.Subtract(8, 4));
// Challenge 3 used
Console.Write("What was the last thing you ate?: ");
string ate = Console.ReadLine();
Console.Write("What was your first pet's name?: ");
string pet = Console.ReadLine();
methods.MadMaxName(pet, ate);
// Challenge 4
Console.Write("Are you wearing clothes? Y/N: ");
string answer = Console.ReadLine();
string ansLow = answer.ToLower();
switch (ansLow)
{
case "y":
Console.WriteLine("Good");
break;
case "n":
Console.WriteLine("Put some clothes on!");
break;
default:
Console.WriteLine("Please answer with a Y or N");
break;
}
// Challenge 5
bool happy = true;
Console.Write("Are you happy? Y/N: ");
string happi = Console.ReadLine();
string happiness = happi.ToLower();
if (happiness == "y")
{
happy = true;
}
else if (happiness == "n")
{
happy = false;
}
else
{
Console.WriteLine("Please answer with an Y or N");
}
Console.WriteLine(happy == true ? "Glad to hear!" : "Sorry to hear that");
// Challenge 6
Console.Write("Tell me what you make annually for some appropriate financial advice: $");
int moolah = Int32.Parse(Console.ReadLine());
if (moolah > 100000)
{
Console.WriteLine("You should probably have a real financial advisor.");
}
else if (moolah <= 100000 && moolah >= 51000)
{
Console.WriteLine("Invest in a home and build some equity.");
}
else if (moolah < 51000 && moolah >= 11000)
{
Console.WriteLine("Invest in stocks. Check them everyday.");
}
else if (moolah >= 1000 && moolah < 11000)
{
Console.WriteLine("Invest in BitCoin. Check it every five minutes.");
}
else if (moolah > 0 && moolah < 1000)
{
Console.WriteLine("Buy some Lottery tickets. Hopefully it'll work out.");
}
else if (moolah == 0)
{
Console.WriteLine("That's rough buddy.");
}
else
{
Console.WriteLine("Please enter a positve value");
}
Console.ReadLine();
}
}
}