コード例 #1
0
ファイル: Program.cs プロジェクト: Pollolewis/AcademiaParte1
        static void ShowAddNotesMenu()
        {
            CurrentOption = "n";
            Console.WriteLine("Menu de añadir notas. Añada notas [dni*nombre*nota] y presione al enter");
            Console.WriteLine("Presione m para acabar y volver al menú principal");

            while (true)
            {
                var notaText = Console.ReadLine();

                if (notaText == "m")
                {
                    break;
                }
                else
                {
                    char[] c1    = { '*' };
                    var    spaso = notaText.Split(c1);

                    var dni      = spaso[0];
                    var name     = spaso[1];
                    var markText = spaso[2].Replace(".", ",");

                    #region Nota
                    double nota;
                    if (double.TryParse(markText, out nota))
                    {
                        if (!Marks.ContainsKey(dni))
                        {
                            Marks.Add(dni, new List <double>());
                        }

                        Marks[dni].Add(nota);
                    }
                    else
                    {
                        Console.WriteLine($"valor introducidio [{notaText}] no válido");
                    }
                    #endregion

                    #region Name

                    if (!Students.ContainsKey(dni))
                    {
                        Students.Add(dni, name);
                    }
                    else if (!string.IsNullOrEmpty(name))
                    {
                        //else if (name != "" && name != null)
                        Students[dni] = name;
                    }

                    #endregion
                }
            }

            ClearCurrentConsoleLine();
            Console.WriteLine();
            ShowMainMenu();
        }
コード例 #2
0
        internal static void Test()
        {
            //Using the Enums
            StudentStatus status = (StudentStatus.Missing);

            Console.WriteLine(status.ToString());
            foreach (var item in Enum.GetNames(typeof(StudentStatus)))
            {
                Console.WriteLine(item);
            }

            Marks m1 = new Marks();

            m1.ShowDetails();
            Marks m2;

            m2.RollNo  = 1234;
            m2.Name    = "Ravivarma";
            m2.Kannada = 98;
            m2.English = 98;
            m2.Social  = 88;
            m2.Science = 78;
            m2.maths   = 69;
            m2.ShowDetails();
        }
コード例 #3
0
ファイル: StudentIITP1.cs プロジェクト: 953506/css-953506
 public StudentIITP1()
 {
     _faculty   = "ФКСиС";
     _specialty = "Информатика и технологии программирования";
     _course    = 1;
     _group     = 953506;
     Marks Student = new Marks(9);
 }
コード例 #4
0
        public static void consume()
        {
            Console.WriteLine("consume");

            Marks m = new Marks();

            m.setMarks("chayank", 55, 55, 55);
            m.calculate();
            m.GetMarks();


            Marks m1 = new Marks();

            m1.setMarks("rav", 67, 45, 95);
            m1.calculate();
            m1.GetMarks();
        }
コード例 #5
0
        public static void Consume()
        {
            Marks m1 = new Marks();

            m1.setMarks("Arihant", 90, 90, 85);
            m1.calculate();
            m1.getMarks();

            Marks m2 = new Marks();

            m2.setMarks("Prajjwal", 95, 80, 85);
            m2.calculate();
            m2.getMarks();

            Marks m3 = new Marks();

            m3.setMarks("Chayank", 99, 70, 65);
            m3.calculate();
            m3.getMarks();
        }