Pages

Make a c# program that calculate 1st Year/2nd Year/Intermediate Combine % Persentage by taking all subjects num as input

INPUT:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mARKS_CALCUlTOR
{
    class Program
    {
        static void Main(string[] args)
        {
            double phyI, chemI, mathI, islI, engI, urdI, obtnum, persentage, avgmarks, obtnumI, persentageI, avgmarksI, phyII, chemII, mathII, islII, engII, urdII, obtnumII, persentageII, avgmarksII;
            Console.WriteLine("Please inter your intermediate marks");
            char op;
            Console.WriteLine("if you want to calculate your 1st year marks press 1 or \nif you want to calculate your 2ndyear marks please press 2 or \nif you want to calculate your 1st year and 2nd year combine marks press 3");
            op = Convert.ToChar(Console.ReadLine());
           
                if (op == '1')
                {
                    Console.WriteLine("Please enter your 1st year marks");
                Console.WriteLine("Please enter your physicsI marks");
                phyI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please inter your chemistryI marks");
                chemI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("please enter your mathematicsI marks");
                mathI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your islamiatI marks");
                islI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your englishI marks");
                engI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your urduI marks");
                urdI = Convert.ToInt32(Console.ReadLine());
                obtnumI = phyI + chemI + mathI + islI + engI + urdI;
                persentageI = (obtnumI * 100) / 550;
                avgmarksI = obtnumI / 6;
                Console.WriteLine("you obtained {0} marks and your persentage is {1} and your average marks are {2}", obtnumI, persentageI, avgmarksI);
            }

            else

           
                if (op == '2')
                {
               
                Console.WriteLine("Please enter your 2nd year marks");
                Console.WriteLine("Please enter your physicsII marks");
                phyII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please inter your chemistryII marks");
                chemII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("please enter your mathematicsII marks");
                mathII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your islamiatII marks");
                islII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your englishII marks");
                engII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your urduII marks");
                urdII = Convert.ToInt32(Console.ReadLine());
                obtnumII = phyII + chemII + mathII + islII + engII + urdII;
                persentageII = (obtnumII * 100) / 550;
                avgmarksII = obtnumII / 6;
                Console.WriteLine("you obtained {0} marks and your persentage is {1} and your average marks are {2}", obtnumII, persentageII, avgmarksII);
            }

            else

           
                if (op == '3')
                {
               
                Console.WriteLine("Please inter your 1st year and 2nd year marks");
                Console.WriteLine("Please enter your physicsI marks");
                phyI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please inter your chemistryI marks");
                chemI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("please enter your mathematicsI marks");
                mathI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your islamiatI marks");
                islI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your englishI marks");
                engI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your urduI marks");
                urdI = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your physicsII marks");
                phyII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please inter your chemistryII marks");
                chemII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("please enter your mathematicsII marks");
                mathII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your islamiatII marks");
                islII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your englishII marks");
                engII = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Please enter your urduII marks");
                urdII = Convert.ToInt32(Console.ReadLine());
                obtnum = phyII + chemII + mathII + islII + engII + urdII + phyI + chemI + mathI + islI + engI + urdI;
                persentage = (obtnum * 100) / 1100;
                avgmarks = obtnum / 12;
                Console.WriteLine("you obtained {0} marks and your persentage is {1} and your average marks are {2}", obtnum, persentage, avgmarks);
            }


        }
     }
  }

OUTPUT:


No comments:

Post a Comment