-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
78 lines (57 loc) · 2.75 KB
/
Copy pathProgram.cs
File metadata and controls
78 lines (57 loc) · 2.75 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
using System;
namespace VariablesCS
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to C#");
/*Explorer Mode*/
//Creating Variables
int numberOfCupsOfCoffee = 1;
string fullName = "Kayla Smart";
var today = DateTime.Now;
Console.WriteLine(numberOfCupsOfCoffee + " " + fullName + " " + today);
//Getting User Input
Console.Write("Please enter your name: ");
string userName = Console.ReadLine();
Console.WriteLine("Greetings, " + userName + ".");
//Getting Different Input Types From User
Console.Write("Please enter two numbers: ");
string firstNumberAsString = Console.ReadLine();
string secondNumberAsString = Console.ReadLine();
//Convert String to Double
double firstOperand = double.Parse(firstNumberAsString);
double secondOperand = double.Parse(secondNumberAsString);
//Do Math
double sum = firstOperand + secondOperand;
double difference = secondOperand - firstOperand;
double product = firstOperand * secondOperand;
double quotient = firstOperand / secondOperand;
double remainder = firstOperand % secondOperand;
//Output
Console.WriteLine("You entered " + firstOperand + " and " + secondOperand + ".\n"
+ firstOperand + " plus " + secondOperand + " equals " + sum + ".\n"
+ secondOperand + " minus " + firstOperand + " equals " + difference + ".\n"
+ firstOperand + " times " + secondOperand + " equals " + product + ".\n"
+ firstOperand + " divided by " + secondOperand + " equals " + quotient + ".\n"
+ firstOperand + " mod " + secondOperand + " leaves a remainder of " + remainder + ".\n");
/*Adventure Mode*/
//Use Logic
Console.Write("Please enter your name: ");
string userNameTwo = Console.ReadLine();
if (userNameTwo == "Alice")
{
Console.WriteLine("Her name is AAAAAALLLLLLLIIIIIIIIIICCCCCCCCEEEE! She crawls into the window through shapes and shadows. AAAAAALLLLLLLIIIIIIIIIICCCCCCCCEEEE! And even though she's dreaming, she knows...");
}
else
{
Console.WriteLine("Greetings, " + userNameTwo + ".");
}
//Used DateTime Above; Converting Output
Console.WriteLine(today.ToString("dd-MMM-yyy"));
/*Epic Mode*/
//Move Code to New Method and Call Main
}
}
}