Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Good Morning, Please help I am writing a code in C#. I need the incorrect answers to loop and to implement a method. And if

Good Morning,

Please help I am writing a code in C#. I need the incorrect answers to loop and to implement a method. And if possible eliminate the Console.WriteLine() . I also need the scores to tally for the correct answers and show at the end of the loop. Any guidance in this would be much appreciated please see the code that I have so far attached below.

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

namespace ENGR115projectMcDowell { class WriteLine {

static void Main(string[] args) { // introduction. string PersonalName = "Matthew McDowell"; string ProjectName = "ENGR 115 Course Project"; string Dates = "Aug-Oct 2018"; //print personal data to screen. { Console.WriteLine("Welcome to the project for " + PersonalName); Console.WriteLine(ProjectName); Console.WriteLine(Dates); Console.ReadKey(); { // this section will expalin the peramiters of the test } string directions = "This quiz is made up of 10 questions combination of True/False statements, and multiple choice questions. If you are correct you will not need to repeat the question. If you are wrong you will be required to repeat the question later. ADDItiONAL INFORMATION User must hit space bar once then answer enter answer as = a,b,c,true,false.";//if not the system will state the answer given is wrong. Console.WriteLine(directions); Console.ReadKey(); string Start = "Lets Begin"; Console.WriteLine(Start); Console.ReadKey(); } //Answer Key string A1 = "true"; string A2 = "false"; string A3 = "a"; string A4 = "b"; string A5 = "c"; string Repeat = "If you did not get 100 please relpeat exam"; int CorrectAnswers = 0; for (; ; ) { Console.WriteLine(); Console.WriteLine();

///Here we will begin the quiz

const string V1 = "Q1. What does the symbole Vr indicate?"; Console.WriteLine(V1); string answerchoices = "a.Rotation b.Best angle of climb c.Best rate of climb"; Console.WriteLine(answerchoices); Console.ReadKey(); string userInput1 = Console.ReadLine(); if (userInput1 == A3) { if (userInput1 == A3) Console.WriteLine("correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A3); }

Console.WriteLine(); Console.WriteLine(); // string V2 = "Q2. Va is the maximum allowable structural speed for full defection of control surfaces on an aircraft"; Console.WriteLine(V2); string answerchoicesV2 = "true false"; Console.WriteLine(answerchoicesV2); Console.ReadKey(); string userInput2 = Console.ReadLine(); if (userInput2 == A1) { Console.WriteLine("correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A1); }

Console.WriteLine(); Console.WriteLine(); Console.WriteLine(); // const string V3 = "Q3. Vso is the velocity of stall speed for an aircraft."; Console.WriteLine(V3); string answerchoicesV3 = "true false"; Console.WriteLine(answerchoicesV3); Console.ReadKey(); string userInput3 = Console.ReadLine(); if (userInput3 == A1) { Console.WriteLine("correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A1); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

const string V4 = "Q4. The maximum allowable airspeed under FL100 is 300 Knots."; Console.WriteLine(V4); string answerchoicesV4 = "true false"; Console.WriteLine(answerchoicesV4); Console.ReadKey(); string userInput4 = Console.ReadLine(); if (userInput4 == A2) { Console.WriteLine("correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A2); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

const string V5 = "Q5. Vx is the symbol for rotation speed."; Console.WriteLine(V5); string answerchoicesV5 = "true false"; Console.WriteLine(answerchoicesV5); Console.ReadKey(); string userInput5 = Console.ReadLine(); if (userInput5 == A2) { Console.WriteLine(" correct "); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A2); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

const string V6 = "Q6. Standard atmospheric pressure is ____ ?"; Console.WriteLine(V6); string answerchoicesV6 = "a.29.92, b.30.02,c.50.05"; Console.WriteLine(answerchoicesV6); Console.ReadKey(); string userInput6 = Console.ReadLine(); if (userInput6 == A3) { Console.WriteLine(" correct "); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A3); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

const string V7 = "Q7. A star above an airport on an regional sectional chart indicates?"; Console.WriteLine(V7); string answerchoicesV7 = " a.Lighted runway, b.Fuel at airport, c.Free parking"; Console.WriteLine(answerchoicesV7); Console.ReadKey(); string userInput7 = Console.ReadLine(); if (userInput7 == A4) { Console.WriteLine("correct "); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A4); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

// const string V8 = "Q8.The Symbol Vy stands for_"; Console.WriteLine(V8); string answerchoicesV8 = "a.Rotation b.Low approach c.Best Rate"; Console.WriteLine(answerchoicesV8); Console.ReadKey(); string userInput8 = Console.ReadLine(); if (userInput8 == A5) { Console.WriteLine("correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A5); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

const string V9 = "Q9.You will not need to contact ATC when transiting through "; Console.WriteLine(V9); string answerchoiceV9 = "a.Class bravo airspace b.Class Delta airspace c.Class E airspace"; Console.WriteLine(answerchoiceV9); Console.ReadKey(); string userInput9 = Console.ReadLine(); if (userInput9 == A5) { Console.WriteLine("Correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A5); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

const string V10 = "Q10. Blue lines on an VFR sectional indicate?"; Console.WriteLine(V10); string answerchoicesV10 = "a.Approach vectors b.VFR corridors c.Runways"; Console.WriteLine(answerchoicesV10); Console.ReadKey(); string userInput10 = Console.ReadLine(); if (userInput8 == A4) { Console.WriteLine("correct"); CorrectAnswers++; } else { Console.WriteLine("incorrect answer is {0}", A4); } Console.WriteLine(); { string End = "You have reached the end of the Quiz please review answers and repeat until you get all 10 correct"; Console.WriteLine(End); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine();

; if (CorrectAnswers < 10) { Console.WriteLine("Score CorrectAnswers:{}", CorrectAnswers); CorrectAnswers++; }

else; } } } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago