Professional Documents
Culture Documents
1. Sac County:
Write a program, in any language you prefer, that prints the numbers from 1 to 100. But
for multiples of three print "Sac" instead of the number, and for the multiples of five
print "County". For numbers which are multiples of both three and five print
"SacCounty".
Answer public void
PrintMultiplesOfThreeAndFive()
{
for (int i = 1; i <= 100; i++)
{
if (i % 15 == 0)
Console.WriteLine("SacCounty");
else if (i % 3 == 0)
Console.WriteLine("Sac");
else if (i % 5 == 0)
Console.WriteLine("County");
else
Console.WriteLine(i);
}
}
2. ASP.NET MVC
Create a web service controller that allows the origin http://www.saccounty.net to
access it using CORS attributes with a method that returns a person object.
public class Person
{
public int Id { get; set; } public string Code { get; set; }
public string Name { get; set; }
}
Create a SQL User-Defined Function called AuthorizeProject that takes parameters for the ProjectID and
the SystemsUserID, and returns a bit representing whether the user is authorized (as a PM) for the given
project. In order to be authorized as a PM, the user must be a current member of the project and the
must have at least one role that includes PM authority (Boolean field isPMRole = true).
Answer