Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
List, Object, Classes, Function
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { List<Employee> list = new List<Employee>(); list.Add(new Employee() { ID = 100, name = "Farhad", Salary = 10, Experience = 2 }); list.Add(new Employee() { ID = 200, name = "Akash", Salary = 20, Experience = 1 }); Employee.Promotion(list); } } class Employee { public int ID { get; set; } public string name { get; set; } public int Salary { get; set; } public int Experience { get; set; } public static void Promotion(List<Employee> list) { for (int i = 0; i < 2; i++) { if (list[i].Experience >= 2) { Console.WriteLine(list[i].name + " is Promoted"); } } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
name generator
Square Integer Matrix
Enum Extension
Sorting Square Problem
sdfghjuyhtgrfedsdf
Volatile madness
Create id
asxsd
Anq Calc
Programmes
Please log in to post a comment.