Question
This module week, you will implement repetitive tasks in your program while using conditional and iteration statements in C#. Implement a loop option that suits
This module week, you will implement repetitive tasks in your program while using conditional and iteration statements in C#.
- Implement a loop option that suits your project. The goal is to cycle through all questions in a first round and read the appropriate users input from the console.
- Mark whether the input is the correct answer.
- Cycle through all incorrectly answered questions in a second round.
- Tally the results and display the number of correct/incorrect answered questions, at the end.
- Test the code for different input values of the variable(s) including out-of-range values and adding a statement displaying an error message.
- Document a successful run of the program.
This is what I need help with, in C#. I do not understand what codes to use, where to put them, or how. Below is what I ave for now. The project is to make a functioning quiz with multiple choice and true and false. If the user answers incorrectly the first time, it is supposed to tell the user the answer is inocrrect, then proceed to the next question. The program will then loop back to the questions gotten incorrect and give the user a second try in the order the original questions were given. Then the quiz will end. This is what I have:
static void Main(string[] args) { Console.WriteLine("Olivia Karabin: ENGR 115 Checkpoint 3");
//Reviewing initial answer count int correctAnswercount = 0; int correctAnswercount = 0;
//Reviewing the wrong answers
for(int i = 0; i < 10; i++) { if(Array[i]=="Correct") } { correctAnswercount++; } else { wrongAnswercount++; if (if==0) { questionone(); }
//Declare and initialize varibles for question 1 string questionOne = "What is the terminology for the fingers?"; string answerQoneA = "A. carpals"; string answerQoneB = "B. buccal"; string answerQoneC = "C. endo-"; string answerQoneD = "D. phalanges"; Console.WriteLine(" " + questionOne); Console.WriteLine(" " + answerQoneD); Console.WriteLine(answerQoneA); Console.WriteLine(answerQoneB); Console.WriteLine(answerQoneC); string answerQuestionOne = Console.ReadLine();
if (answerQuestionOne == "D. phalanges") { Console.WriteLine("Correct!"); } else if (answerQuestionOne == "A. carpals") { Console.WriteLine("Incorrect!"); } else if (answerQuestionOne == "B. buccal") { Console.WriteLine("Incorrect!"); } else if (answerQuestionOne == "C. endo-") { Console.WriteLine("Incorrect!"); }
//Declare and initialize varibles for question 2 string questionTwo = "The average adult has 206 bones."; bool answerQTwoA = true; bool answerQTwoB = false;
Console.WriteLine(" " + questionTwo); Console.WriteLine(" " + answerQTwoA); Console.WriteLine(answerQTwoB); string answerQuestionTwo = Console.ReadLine(); if (answerQuestionTwo == "A. true") { Console.WriteLine("Correct!"); } else if (answerQuestionTwo == "B. false") { Console.WriteLine("Incorrect!"); } Console.WriteLine("Your answer is: {0}", answerQuestionTwo);
PLEASE HELP.
If I need to correct or edit anything I have so far, please let me know. I do not understand what codes or where to write it in order to make it properly function.
THANKS IN ADVANCED
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started