public override string ToString() { //we hand over sales increase to a variable delegate of delgSaleincrease delgSaleIncrease results = salesIncrease; //result is return where we have results[parameter 1, parameter 2] //The parameters are what the sales increase method had required return($"Projected Sales increase: is {results(sales, percent):C}"); }
public string IncreaseResults() { string output = string.Empty; //Here from the delegate that was created on line 27 instead of just throwing the method in, //the delegate instead is being given parameters (a double sale, and a double percent); // after the lamda expression "=>" and expression must be given. //the expression (sale * percent/100) + sale uses the parameters given in the parenthesis giving the results later //we still throw in the variables to the delegate we will have in the curly braces delgSaleIncrease increasedby = (double saleProvided, double percentProvided) => (saleProvided * percentProvided / 100) + saleProvided; output = $"Projected sales are {increasedby(sales, percent)}"; return(output); }