+ 1

I want to solve the question c#

Instructions Understand the Classes: Review the provided classes Exam, Question, Essay, TrueFalse, MultipleChoice, and TakeExam. Write the Main Function: Create an instance of Exam. Add questions to the exam. Create an instance of TakeExam and start the exam. ExamTypeEnum enum ExamTypeEmum { Quiz, Mid, Final } Abstract Question Class abstract class Question { public int ID { get; set; } public string CorrectAnswer { get; set; } public bool IsCorrect(string answer) { if (!Validate()) { Console.WriteLine("Question is not valid"); return false; } return answer == CorrectAnswer; } public abstract bool Validate(); } Essay Class class Essay : Question { public string Text { get; set; } public override bool Validate() { return !string.IsNullOrEmpty(Text); } } TrueFalse Class class TrueFalse : Essay { public string Choice1 { get; set; } public string Choice2 { get; set; } public override bool Validate() { return base.Validate() && !string.IsNullOrEmpty(Choice1) && !string.IsNullOrEmpty(Choice2); } } MultipleChoice Class class MultipleChoice : TrueFalse { public string Choice3 { get; set; } public string Choice4 { get; set; } public override bool Validate() { return base.Validate() && !string.IsNullOrEmpty(Choice3) && !string.IsNullOrEmpty(Choice4); } } Exam Class class Exam { public int ID { get; private set; } public ExamTypeEnum ExamType { get; private set; } public DateTime ExamDateAndTime { get; private set; } private List<Question> Questions { get; set; } public Exam(int id, ExamTypeEnum type, DateTime examdate) { Questions = new List<Question>(); ID = id; ExamType = type; ExamDateAndTime = examdate; } public void AddQuestion(Question question) { Questions.Add(question); } public void RemoveQuestion(Question question) { Q

7th Jan 2025, 11:59 PM
Houdefa AL-REFAY
Houdefa AL-REFAY - avatar
3 ответов
+ 1
Houdefa AL-REFAY, Try it by yourself first.
8th Jan 2025, 7:20 AM
Alhaaz
Alhaaz - avatar
+ 1
Houdefa AL-REFAY comment out some lines in your code: //ExamTypeEnum //AbstractQuestionClass .... etc. You should include necessary libraries Structure your code properly under a namespace... You have typos in ExamTypeEmum in several places... maybe you mean ExamTypeEnum?
8th Jan 2025, 12:13 PM
Bob_Li
Bob_Li - avatar
0
What do you need in the main? Is it not working, post the code as per this guide and someone could help you: https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app
8th Jan 2025, 10:21 AM
Ausgrindtube
Ausgrindtube - avatar