Ошибка с#, не виден член класа

192
30 мая 2018, 13:30
 ошибка: 13.cs(114,30): error CS1061: Type `ConsoleApp11.Test' does not contain a definition for `Theme' and no extension method `Theme' of type `ConsoleApp11.Test' could be found. Are you missing an assembly reference?
 13.cs(23,11): (Location of the symbol related to previous error)

13.cs(116,30): error CS1061: Type ConsoleApp11.Test' does not contain a definition forMaxGrade' and no extension method MaxGrade' of typeConsoleApp11.Test' could be found. Are you missing an assembly reference?

using System;
using System.IO;
using static System.Math;
using static System.Console;
namespace ConsoleApp11
{
    class Qestion
    {
        protected string text;
        protected string ans;
        public Qestion() : this("", "") { }
        public Qestion(string text, string ans)
        {
            this.text = text;
            this.ans = ans;
        }
        public double getGrade()
        {
            return (text == ans) ? 5 : ((text[0] == ans[0]) ? 2.5 : 0);
        }
    }
    class Test
    {
        protected int cntQestion;
        protected double grade;
        protected Qestion[] qestions;
        public Test() : this(0) { }
        public Test(int cntQestion)
        {
            grade = 0;
            this.cntQestion = cntQestion;
            qestions = new Qestion[cntQestion];
        }
        public int CntQestion
        {
            get { return cntQestion; }
            set { cntQestion = value; }
            }
    public double Grade
        {
            get { return grade; }
            }
    public void init(Qestion[] qest)
        {
            qestions = qest;
            for (int i = 0; i < cntQestion; ++i)
            {
                grade += qestions[i].getGrade();
            }
        }
        public virtual double getGenarlGrade()
        {
            return (5 * cntQestion * 100 / grade) * 40;
        }
    }
    class Modul : Test
    {
        protected double maxGrade;
        protected string theme;
        public Modul() : this(0, 0, "") { }
        public Modul(int CntQestion, double maxGrade, string theme)
        : base(CntQestion)
        {
            this.maxGrade = maxGrade;
            this.theme = theme;
        }
        public double MaxGrade
        {
            get { return maxGrade; }
            set { maxGrade = value; }
            }
    public string Theme
        {
            get { return  theme; }
            set { theme = value; }
            }
    public override double getGenarlGrade()
        {
            return (5 * cntQestion * 100 / grade) * maxGrade;
        }
    }
    class Exam : Test
    {
        protected double gradePerSem;
        public Exam() : this(0, 0) { }
        public Exam(int CntQestion, int gradePerSem)
        : base(CntQestion)
        {
            this.gradePerSem = gradePerSem;
        }
        public double GradePerSem
        {
            get { return gradePerSem; }
            set { gradePerSem = value; }
            }
    public override double getGenarlGrade()
        {
            return (5 * cntQestion * 100 / grade) * 40 + gradePerSem;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Test[] works = new Test[10];
            for (int i = 0; i < 10; ++i)
            {
                WriteLine("Enter Exam or Modul");
                if (ReadLine() != "Exam")
                {
                    works[i] = new Modul();
                    WriteLine("Enter modul's theme");
                    works[i].Theme = ReadLine();
                    WriteLine("Enter max grade");
                    works[i].MaxGrade = Convert.ToInt32(ReadLine());
                    WriteLine("Enter count of qestions");
                    works[i].CntQestion = Convert.ToInt32(ReadLine());
                    WriteLine("Enter qestions");
                    Qestion[] qest = new Qestion[works[i].CntQestion];
                    for (int j = 0; j < works[i].CntQestion; ++j)
                    {
                        WriteLine("Enter {0} Qestion's text & answer", j);
                        qest[j] = new Qestion(ReadLine(), ReadLine());
                    }
                    works[i].init(qest);
                    WriteLine("Grade is" + works[i].getGenarlGrade());
                }else{
                }
            }
        }
    }
}
READ ALSO
Пример программы (привязка данных)

Пример программы (привязка данных)

Тут Пример привязки данных содержится пример программы на WPFЕсли у кого будет время и терпение объясните каким образом в ListBox который находится...

189
Выпуск приложение на устройстве Android

Выпуск приложение на устройстве Android

Пишу первое приложение на Monogame Android SDK, и столкнулся с проблемой: Я не знаю, как сделать проектapk и запустить на телефоне

230