Console app, quiz in c# visual studio

Updated on September 10, 2017 in [A] C# .Net
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
9 on August 28, 2017

I hate to ask such a rudimentary question, but I must. I am taking a class called intro to computing for engineering. The class is poorly organized and the teacher is completely useless. The project is to write a console application that displays a ten question quiz, some multiple choice, and some true/false. I have no coding background and there is no help from the teacher. Finding data online is difficult because the only examples are of people using radio buttons and more complex code. I am intelligent and once I have the ideas, or an example to learn from, I’ll be able to move forward. I simply don’t know enough about coding to move forward. The extent of my skill is getting the console to print a stupid line of text.

  • Liked by
Reply
0 on August 28, 2017

What’s the question?

  • Liked by
Reply
Cancel
1 on August 28, 2017

If you don’t have any requirements for how its written (such as implementing custom methods to handle printing and receiving input then the following will help you.

 

Here is an example of how you can handle multiple choice and boolean questions.

 

//Intro text
 Console.WriteLine("--------------------------------");
 Console.WriteLine("Welcome to the _____ QUIZ!");
 Console.WriteLine("--------------------------------");
 
//multiple choice question
 Console.WriteLine("\nQuestion 1. Multiple Choice");
 Console.WriteLine("Blah blah blah, I am a difficult question...");
 Console.WriteLine("\nA. Option here....");
 Console.WriteLine("B. Option here....");
 Console.WriteLine("C. Option here....");
 Console.WriteLine("D. Option here....");
 
Console.WriteLine("\n");
 Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
 string answer1 = Console.ReadLine();
 
//deciding answer based on input
 if(answer1.ToUpper() == "A")
 {
 Console.WriteLine("------Correct!------");
 Console.WriteLine("\n Next Question...");
 }
 else
 {
 Console.WriteLine("------Wrong!------");
 Console.WriteLine("\n Next Question...");
 }
//True or False question
 Console.WriteLine("\nQuestion 2. True or False:");
 Console.WriteLine("Blah blah blah, I am another difficult question...");
 Console.WriteLine("\n Please input T for true, or F for False");
 Console.WriteLine("\n");
 string answer2 = Console.ReadLine();
 
if(answer2.ToUpper() == "T")
 {
 Console.WriteLine("------Correct!------");
 Console.WriteLine("\n Next Question...");
 }
 else
 {
 Console.WriteLine("------Wrong!------");
 Console.WriteLine("\n Next Question...");
 }
 Console.WriteLine("Rinse and repeat!");
Console.ReadKey();
 

 

Literally all you need is standard if statements, Console.WriteLine();, and Console.ReadLine();

 

Goodluck,

 

– J

on August 28, 2017

Wow, thanks I really appreciate you taking the time to help me!

Show more replies
  • Liked by
Reply
Cancel
0 on September 4, 2017

unfortunately, I need more help… I am learning, but not fast enough to complete this within 9 weeks.  I have had to move since the start of this class, and as we speak I am in the hospital awaiting surgery for a kidney stone tomorrow…  This teacher is as useless as a one legged man in an ass kicking contest.  Anyways, here is the description.  It’s not just me, the entire class is lost.   

During this course, you will work on a “Quiz” program using the programming language C#. The topic of the quiz can be a topic with which you are familiar. This quiz can be work related, general knowledge, or any set of questions where there is a specific answer. Ignore questions where long descriptions or general answers needed. The program should display the questions, one at a time, and possible answers, and accept an answer from the user. If the answer is correct, the program should go on to the next question. If it is incorrect, store the question for the second attempt and go on to the next question. When the list of questions has ended, the questions that were missed previously, or answered incorrectly, should be displayed again, in their original order. Keep a count of the correct answers for each category of questions and display the final count after two attempts. Also, display the correct answer, when necessary, in the second round of questioning.

Limit the quiz to ten (10) questions. Include questions from both true/false and multiple-choice categories. Four (4) possible answers should be listed in multiple-choice questions.

  • Liked by
Reply
Cancel
0 on September 4, 2017

I wanted to add something,  I don’t want you all to think I am incapable or that I am asking for you to do this for me.  

I did some really simple basic programming when I was a kid on my dad’s Tandy TRS-80 lol, but I know nothing about C.  I can read about each data type, function, or whatever, and figure out how to write that part by reverse engineering. However, I have no idea how these different things communicate with each other.  It just looks like a bunch of text with a million brackets and semicolons.  I don’t understand how classes communicate, and I don’t know if what the teacher is asking is possible in one single piece of code.  The teacher refuses to help, with the exception of posting some random links to c# websites.  

  • Liked by
Reply
Cancel
0 on September 5, 2017

If you require this in C, I cannot be of help. However if you wish for a solution in C#, I will be at your service.

 

Let me know, and I’ll put something together (all you’ll have to do is edit the strings that are your questions 😉

  • Liked by
Reply
Cancel
0 on September 6, 2017

Are you ready? 

 

Here is a working solution (of course in C#), I posted it on GitHub because sharing lots of code here is messy…

 

Here is the link: https://github.com/s1l3nt-one/ConsoleQuiz

 

Basically, create 2 class files, name them ‘Results’, and ‘Question’.

Copy/Paste the code from the files on GitHub to your newly created class files. Then do the same for your Program.cs.

Then tell your teach he’s an ass.

Let me know if you have any questions, or if you need things explained. The solution is using 2 custom classes, one of which is static. It works perfectly if you put it together correctly.

I’ll be awaiting your response.

 

Cheers,

-J

 

 

 

 

  • Liked by
Reply
Cancel
0 on September 10, 2017

As I have stated before, you are too kind to take your own time to help me… This class has ruined my desire to learn C#, but people like you give me some hope that I can learn and enjoy it without the pressure of an absent instructor

  • Liked by
Reply
Cancel
0 on September 10, 2017

and, sorry for the delay, I was in the hospital the night I posted and had surgery the next day.

  • Liked by
Reply
Cancel