Answer to Question #318545 in C# for madhu

Question #318545

Create a class called Scholarship which has a function Public void Merit() that takes marks and fees as an input. Merit method should get an marks as input using params

If the given mark is >= 70 and <=80, then calculate scholarship amount as 20% of the fees

If the given mark is > 80 and <=90, then calculate scholarship amount as 30% of the fees

If the given mark is >90, then calculate scholarship amount as 50% of the fees.

In all the cases return the Scholarship amount


1
Expert's answer
2022-03-26T12:41:28-0400
    class Scholarship
    {
        public void Merit(double marks, double fees)
        {
            if (marks >= 70 && marks <= 80)
            {
                Console.WriteLine($"Scholarship amount: {0.2 * fees}");
            }
            else if (marks > 80 && marks <= 90)
            {
                Console.WriteLine($"Scholarship amount: {0.3 * fees}");
            }
            else if (marks > 90)
            {
                Console.WriteLine($"Scholarship amount: {0.5 * fees}");
            }
        }
    }
    internal class Program
    {
        static void Main(string[] args)
        {
            Scholarship scholarship = new Scholarship();
            scholarship.Merit(95, 10000);


            Console.ReadKey();
        }


    }

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