Answer to Question #327104 in C# for mandeep

Question #327104


 

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% 


1
Expert's answer
2022-04-11T07:48:14-0400
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);
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS