1 The first method to be called should ask a salesperson for the dollar value of daily sales and return the entered value to the Main() method.
2 The second method to be called should calculate the salesperson’s commission based on the rates in the following table.
Sales
Commission
$0 to $999
3%
$1000 to $2999
4%
$3000 and up
5%
using System;
namespace commission
{
class Program
{
public static double DailySales()
{
double dollars;
Console.Write("Enter the value of daily sales in dollars: ");
dollars = Convert.ToDouble(Console.ReadLine());
return (dollars);
}
public static int Commission (double dollars)
{
int commis;
commis = 0;
if ((dollars >= 0) & (dollars <= 999))
commis = 3;
else if ((dollars >= 1000) & (dollars <= 2999))
commis = 4;
else if (dollars >= 3000)
commis = 5;
return (commis);
}
public static void Main(string[] args)
{
Console.WriteLine("Commission: {0}%", Commission(DailySales()));
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
Comments
Leave a comment