-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (30 loc) · 809 Bytes
/
Copy pathProgram.cs
File metadata and controls
36 lines (30 loc) · 809 Bytes
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
using System;
namespace OOP
{
class Program
{
static void Main(string[] args)
{
try
{
string input;
string name;
Console.Write("Type 1 if you want 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();
//access student object
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");
}
}
}
}