Write C# Program to find the eligibility for an engineering course based on the criteria


Introduction

Write C# Program to find the eligibility for an engineering course based on the criteria. I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. using System;
  2.  
  3. public class charpexercise
  4. {
  5. public static void Main()
  6. {
  7. int p, c, m;
  8.  
  9. Console.Write("\n\n");
  10. Console.Write("Find eligibility for admission :\n");
  11. Console.Write("----------------------------------");
  12. Console.Write("\n\n");
  13.  
  14. Console.Write("Eligibility Criteria :\n");
  15. Console.Write("Marks in Maths >=65\n");
  16. Console.Write("and Marks in Phy >=55\n");
  17. Console.Write("and Marks in Chem>=50\n");
  18. Console.Write("and Total in all three subject >=180\n");
  19. Console.Write("or Total in Maths and Physics >=140\n");
  20. Console.Write("-------------------------------------\n");
  21.  
  22.  
  23. Console.Write("Input the marks obtained in Physics :");
  24. p = Convert.ToInt32(Console.ReadLine());
  25. Console.Write("Input the marks obtained in Chemistry :");
  26. c = Convert.ToInt32(Console.ReadLine());
  27. Console.Write("Input the marks obtained in Mathematics :");
  28. m = Convert.ToInt32(Console.ReadLine());
  29. Console.Write("Total marks of Maths, Physics and Chemistry : {0}\n", m + p + c);
  30. Console.Write("Total marks of Maths and Physics : {0}\n", m + p);
  31.  
  32. if (m >= 65)
  33. if (p >= 55)
  34. if (c >= 50)
  35. if ((m + p + c) >= 180 || (m + p) >= 140)
  36. Console.Write("The candidate is eligible for admission.\n");
  37. else
  38. Console.Write("The candidate is not eligible.\n\n");
  39. else
  40. Console.Write("The candidate is not eligible.\n\n");
  41. else
  42. Console.Write("The candidate is not eligible.\n\n");
  43. else
  44. Console.Write("The candidate is not eligible.\n\n");
  45.  
  46. Console.ReadLine();
  47. }
  48. }

Result

C# language techstudy.org

     





Related Topics




Popular Posts