|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
namespace SalaryCalculator
{
public class SalaryService : ISalaryService
{
private string Calculate(int EducationLevel, int ExperienceInYears, string Currency, bool HasCertificate, bool InvolvedInManagement)
{
// Make our calculations with the input given by the clients
int estimatedSalary = EducationLevel * 100 + ExperienceInYears * 10 + (HasCertificate ? 50 : 0) + (InvolvedInManagement ? 100 : 0);
return String.Format("Your estimated salary is {1}{0}", Currency, estimatedSalary);
}
public string CalculatePartial(int EducationLevel, int ExperienceInYears, string Currency, bool HasCertificate, bool InvolvedInManagement)
{
return Calculate(EducationLevel,
ExperienceInYears,
Currency,
HasCertificate,
InvolvedInManagement);
}
public string CalculateFull(string EducationLevel, string ExperienceInYears, string Currency, string HasCertificate, string InvolvedInManagement)
{
return Calculate(Convert.ToInt32(EducationLevel),
Convert.ToInt32(ExperienceInYears),
Currency,
Convert.ToBoolean(HasCertificate),
Convert.ToBoolean(InvolvedInManagement));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am interested in innovation and creativity in software development and passionate in learning new stuff.