-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
83 lines (64 loc) · 2.76 KB
/
Program.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
72
73
74
75
76
77
78
79
80
81
82
83
using System;
namespace OurDotnetApp
{
class Program
{
static void Main(string[] args)
{
// implicit
// var personName = "Samantha";
// var score = 98;
// // explicit
// string otherScore = "100";
// int price = 50;
// var sentence = "The quick brown fox jumped over the lazy dog";
// var howLong = sentence.Length;
// var rightNow = DateTime.Now;
// var currentMonth = rightNow.Month;
/*
VARIABLES
how many cups of coffee do I drink a day? = numberOfCupsOfCoffee
identify my name = fullName
capture the date = today
use all three bits of information to write out a line
*/
// BELOW WORKS
var numberOfCupsOfCoffee = 0;
var fullName = "Patricia Amheiser ";
DayOfWeek currentDay = DateTime.Today.DayOfWeek;
Console.WriteLine("My name is " + fullName + "I have had " + numberOfCupsOfCoffee + " cups of coffee " + currentDay + ".");
Console.Write("What is your name? ");
var name = Console.ReadLine();
if (name == "Alice")
{
Console.WriteLine("Hey Alice, how do you want your tofu done today? ");
}
else
{
var greeting = $"It's a pleasure to meet you, {name}";
Console.WriteLine(greeting);
Console.Write("What color is your hair? ");
var hairColor = Console.ReadLine();
var compliment = $"That's a pretty shade of {hairColor} {name}, it really suits you.";
Console.WriteLine(compliment);
}
// START new here ----------------//----------------
Console.Write("Type any number. ");
var firstNumberAsAString = Console.ReadLine();
Console.Write("Type a different number. ");
var secondNumberAsAString = Console.ReadLine();
var firstOperand = double.Parse(firstNumberAsAString);
var secondOperand = double.Parse(secondNumberAsAString);
var sum = (firstOperand + secondOperand);
Console.WriteLine(sum);
var difference = (firstOperand - secondOperand);
Console.WriteLine(difference);
var product = (firstOperand * secondOperand);
Console.WriteLine(product);
var quotient = (firstOperand / secondOperand);
Console.WriteLine(quotient);
var remainder = (firstOperand % secondOperand);
Console.WriteLine(remainder);
}
}
}