-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (29 loc) · 1.01 KB
/
Program.cs
File metadata and controls
33 lines (29 loc) · 1.01 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
using System;
namespace OOP_Introduction_Explained
{
class Program
{
static void Main(string[] args)
{
try
{
string input;
string name;
Console.Write("Type 1 if you like to talk to others and type 2 if you would rather keep to yourself: ");
input = Console.ReadLine();
Person MyPerson = new Person();
MyPerson.AskQuestion(int.Parse(input));
Console.WriteLine("You are: " + MyPerson.GetPersonality());
Console.Write("What is your name: ");
name = Console.ReadLine();
Student MyStudent = new Student();
MyStudent.Name = name;
Console.WriteLine("Your Name is: " + MyStudent.Name + " and your personality type is: " + MyStudent.GetPersonality());
}
catch
{
Console.WriteLine("Please enter an integer value.");
}
}
}
}