Answer to Question #288590 in C# for cheth

Question #288590

ABC Corp wants to maintain list of Customers. While accepting the data, you need to validate CreditLimit property. If the value is invalid, you need to raise Exception. We need to implement custom exception class to implement the same.


1
Expert's answer
2022-01-18T17:22:40-0500
using System;

namespace ABC_corp
{
    internal class Program
    {
        public static void Main(string[] args)
        {
          
            Console.WriteLine("ABC Corporation...\n");
            Console.Write("Enter a CreditLimits: ");
            int limits = int.Parse(Console.ReadLine());
            Console.Write("Enter a list of clients: ");
            int n = int.Parse(Console.ReadLine());
            if (n > limits)
            {
                Console.Write("\nValue is invalid");
                throw new Exception("Value is invalid");
            }
            else
                Console.Write("Admissible");
            Console.ReadLine();
        }
    }
}

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