-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathProgram.cs
More file actions
58 lines (49 loc) · 2 KB
/
Program.cs
File metadata and controls
58 lines (49 loc) · 2 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
using System;
using System.Threading;
namespace week1_practice1
{
class Program
{
static void Main(string[] args)
{
int numA;
int numB;
int total;
Console.WriteLine("Enter an integer value for 'a'");
numA = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter an integer value for 'b'");
numB = Convert.ToInt32(Console.ReadLine());
total = numA + numB;
Console.WriteLine("{0} plus {1} equals {2}", numA, numB, total);
Console.ReadKey();
Console.Clear();
double yards = 0.0d;
double inches = 0.0d;
Console.WriteLine("To convert yards, please enter the number of yards");
yards = Convert.ToDouble(Console.ReadLine());
inches = yards * 12;
Console.WriteLine("There are {0} inches in {1} yard(s)", inches, yards);
Console.ReadKey();
Console.Clear();
Boolean people = true;
Boolean f = false;
decimal num = 0.0M;
decimal prod = 0.0M;
Console.WriteLine("Enter a number to be multiplied by iteself");
num = Convert.ToDecimal(Console.ReadLine());
prod = num * num;
Console.WriteLine("The product of {0} multiplied by {0} is {1}", num, prod);
Console.Clear();
String firstName = "Wes";
String lastName = "Garbee";
int age = 34;
String job = "Sales";
String favoriteBand = "Alpha Rev";
String favoriteSportsTeam = "Astros";
Console.WriteLine("Hi! My name is {0} {1} and I am {2} years old.", firstName, lastName, age);
Console.WriteLine("My job is {0}. My favorite band is {1}. My favorite sports team are the {2}.", job, favoriteBand, favoriteSportsTeam);
Console.WriteLine("Press any key to end...");
Console.ReadKey();
}
}
}