23 lines
739 B
C#
23 lines
739 B
C#
string[] users = new String[] { "Admin", "Admin", "Manager", "Manager", "User" };
|
|
int[] levels = new int[] { 56, 55, 21, 19, 100 };
|
|
int counter = 0;
|
|
|
|
foreach (string user in users) {
|
|
int level = levels[counter++];
|
|
switch (user) {
|
|
case "Admin":
|
|
Console.WriteLine($"Wellcome, {(level > 55 ? "Super " : "")}Admin user.");
|
|
break;
|
|
case "Manager":
|
|
if (level >= 20) {
|
|
Console.WriteLine("Contact an Admin for access.");
|
|
} else {
|
|
Console.WriteLine("You do not have sufficient privileges.");
|
|
}
|
|
break;
|
|
default:
|
|
Console.WriteLine("You do not have sufficient privileges.");
|
|
break;
|
|
}
|
|
}
|