-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
88 lines (83 loc) · 1.49 KB
/
Copy pathProgram.cs
File metadata and controls
88 lines (83 loc) · 1.49 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
79
80
81
82
83
84
85
86
87
88
/*
* Created by SharpDevelop.
* User: babak
* Date: 7/4/2015
* Time: 11:10 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
public class Student{
private int id;
private string name;
// private string passMark;
// public void setId(int id1){
// if(id1<0){
// throw new Exception("should not be negative");
// }else{
// this.id=id1;
// }
// }
// public int getId(){
// return id;
// }
public string Email{
get;
set;
}
public string PassMark{
get;
set;
}
public int Id{
set{
if(value<10){
Console.WriteLine("negative");
}
else{
this.id=value;
}
}
get{
return this.id;
}
}
public string Name{
set{
this.name=value;
}
get{
return this.name;
}
}
}
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
// TODO: Implement Functionality Here
Console.Write("Press any key to continue . . . ");
Student st=new Student();
// st.setId(10);
// st.name=null;
// st.passMark="pm";
st.Id=12;
st.Name="babak";
st.PassMark="slf";
st.Email="@g.com";
Console.WriteLine("id is {0} ",st.Id);
Console.WriteLine("name is {0} ",st.Name);
Console.WriteLine("passMark is {0} ",st.PassMark);
Console.WriteLine("Email is {0} ",st.Email);
string s1="hi";
string s2="hi";
if(s1.Equals(s2)){
Console.WriteLine("ok");
}
if(s1==s2){
Console.WriteLine("****** OK");
}
Console.ReadKey(true);
}
}