Answered step by step
Verified Expert Solution
Question
1 Approved Answer
***I am currently taking a C# Programming class* I need help putting all of my questions for a quiz I am making into one array
***I am currently taking a C# Programming class*
I need help putting all of my questions for a "quiz" I am making into one array and to do the same for the answers. Here are screenshots of my current code. ***This is for C# on Visual Studio for Mac*** Please comment again if images are not visible! Thx
**
Debug Default Visual Studio Community 2017 for E K Program.cs ProgramM Main(stringl args) using System; namespace MOD3 4 class Program static void Main(string[] args) //Declaring the variable here //Personalize Code by adding name, course, and date to console 10 12 13 14 15 16 17 18 19 20 21 Console.WriteLine("Simple Quiz Outline"); Console.WriteLine("Your name here?") var name = Console.ReadLine(); Console.WriteLine("What is this course?") var courseConsole.ReadLine); Console.WriteLine("What is todays date?"); var date = Console.ReadLine(); var count=10; 23 24 25 26 27 28 29 30 31 32 //No. of Questions while (true) var correct 0 //No. of Correct Questions 34 35 36 37 38 39 40 41 42 43 //Display Question 1 Console.WriteLine("1."); Console.WriteLine("Is a rainbow an arch of color?"); //Display Options Console.WriteLine("Answer 1. Yes Answer 2. No"); //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); var answer = Console.ReadLine(); 45 46 47 48 49 50 51 if (answer"Yes") correct = correct + 1; Console.WriteLine("Correct!"); DebugDefault Visual Studio Community 2017 for Mac Program.cs Program 104 105 106 107 108 109 110 Main(stringl args) Console.WriteLine ("Answer 2. -Grass"); Console.WriteLine("Answer 3. - People"); Console.WriteLine("Answer 4. Other Rainbows"; //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); 112 113 114 115 116 var Question3-Console. ReadLine); if (Question3"Rain or Water") correct- correct 1; 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 Console.WriteLine("Correct!"); else if (Question3! "Rain or Water") Console.WriteLine( "Incorrect..."); //Taking input from the test taker and displaying it //Suggests using char or string data type for answers with one or more words Console.ReadLine) //Display Question 4 Console.WriteLine ("4.); Console.WriteLine("How many colors are typically associated with rainbows?"); //Display Options Console.WriteLine ("Answer 1 7"); Console.WriteLine("Answer 2.5"); Console.WriteLine("Answer 3. 15"; Console.WriteLine("Answer 4.6"); //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); var Question4 = Console.ReadLine(); if (Question4"7") correct = correct + 1; Visual Studio Community 2017 for Mac Debug Default Program.cs Program M Main(stringI args) 208 209 210 211 212 213 214 215 216 Console.WriteLine("Answer 1. North"); Console.WriteLine("Answer 2. = South"); Console.WriteLine( "Answer 3.No specific location"); Console.WriteLine( "Answer 4.Along the equator"); //Prompt test taker to answer question Console.WriteLine( "Choose correct answer"); 217 218 219 220 221 var Question6-Console. ReadLine) if (Question6"No specific location" correct - correct + 1; 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 Console.WriteLine("Correct!"; else if (Question6!"No specific location") Console.WriteLine( "Incorrect..."); //Taking input from the test taker and displaying it /Suggests using char or string data type for answers with one or more words Console.ReadLine); //Display Question 7 Console.WriteLine("7."; Console.WriteLine ("What Initialism associates themselves with rainbows?"); //Display Options Console.WriteLine ("Answer 1. LGBTQ; Console.WriteLine ("Answer 2.FBI"); Console.WriteLine("Answer 3. = NFL"); Console.WriteLine( "Answer 4 NASA"); //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); 252 253 254 var Question7 = Console.ReadLine(); 255 256 257 258 259 if (Question7 -- "LGBTQ") correct- correct 1; Debug > Default Visual Studio Community 2017 for Mac Run the project or projects in the active run configuration. Builds the projects in the active solution build configuration if necessary 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 Console.WriteLine("Correct!") else if (Question7! "LGBTQ") Console.WriteLine ("Incorrect..."); //Taking input from the test taker and displaying it //Suggests using char data type for answers with one word Console.ReadLine); //Display Question 8 Console.WriteLine("8."; Console.WriteLine("There is a Rainbow Road level in what video game?"; //Display Options Console.WriteLine( "Answer 1. Donkey Kong"); Console.WriteLine ("Answer 2. = Mega Man"); Console.WriteLine("Answer 3. Mario Kart"; Console.WriteLine("Answer 4. -Final Fanytasy"); //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); var Question8-Console. ReadLine) if (Question8"Mario Kart") correct-correct 1; Console.WriteLine("Correct!"); else if (Question8 "Mario Kart") Console.WriteLine("Incorrect..."; //Taking input from the test taker and displaying it /Suggests using char or string data type for answers with one or more words Console.ReadLine); //Display Question 9 Console.WriteLine("9."); D Visual Studio Community 2017 for Mac Debug> Default Program.cs Program- [N] Main(string[] args) 312 313 314 315 316 317 Console.WriteLine("Is the color Black ever included in rainbows?" //Display Options Console.WriteLine("Answer 1. Yes Answer 2. No"; //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); 318 319 320 321 322 323 var Question9 Console. ReadLine(); if (Question9-- "No") 324 325 326 327 328 329 330 331 332 correct-correct 1; Console.WriteLine("Correct!"); else if (Question9! "No") Console.WriteLine("Incorrect..."); 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 //Taking input from the test taker and displaying it //Suggests using bool data type for true or false questions Console.ReadLine(); //Display Question 10 Console.WriteLine("10."); Console.WriteLine ("What may you find at the end of a rainbow?"); //Display Options Console.WriteLine("Answer 1. Trash"); Console.WriteLine ("Answer 2. Your House"); Console.WriteLine("Answer 3. YMCA"); Console.WriteLine( "Answer 4.-Pot of Gold") //Prompt test taker to answer question Console.WriteLine("Choose correct answer"); 354 355 356 357 358 359 360 361 362 363 var Question10Console.ReadLine); if (Question10"Pot of Gold") correct- correct 1; DebugDefault Visual Studio Community 2017 for Mac Program.cs ProgramM Main(stringo args) 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 if (Question10 "Pot of Gold") correctcorrect 1 Console.WriteLine("Correct!"); else if (Question10 "Pot of Gold") Console.WriteLine("Incorrect..."); Console.WriteLine( "No. of Question:" if(correct count) count "Correct Answers:" + correct "Wrong Answers:" + (count correct)) break; //Taking input from the test taker and displaying it //Suggests using char or string data type for answers with one or more word Console.ReadLine()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