Question

C# Sharp for Visual Studio Need Expert help -to use Video studio to write a Quiz....

C# Sharp for Visual Studio

Need Expert help -to use Video studio to write a Quiz.

The quiz is multiple choice with 10 questions.

I need a source code to start and I can copy and paste my questions.

EX:

using System;

namespace Quiz
    class MainClass
    {
        public static void Main(string[] args)
        {

        Console.WriteLine("Welcome to the Quiz!");
            Console.WriteLine("");


                // Declare variables implicitly and explicitly
            var Question 1= "How many trees in a forest?");

               var Answer1a = "3"
                   var Answer1b ="5"
                 var Answer1c ="2"
                var Answer1d ="4"
                var Answer1Solution = "a";
            char Answer1 User;
            // Write variables to the console using formats
            Console.WriteLine(Question1);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer1a, Answer1b, Answer1c, Answer1d);
            Console.WriteLine("Select a, b, c, or d");

Then code for the quiz taker to see his response for question 1; then move to question two, three, four --ten...

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

using System;

namespace Quiz
{
    class MainClass
    {
        public static void Main(string[] args)
        {

            Console.WriteLine("Welcome to the Quiz!");
            Console.WriteLine("--------------------------------");
            Console.WriteLine(" ");

            //Questions
         
            var Question1 = "1. How many trees in a forest?";
            var Question2 = "2. Sample Question";
            var Question3 = "3. Sample Question";
            var Question4 = "4. Sample Question";
            var Question5 = "5. Sample Question";
            var Question6 = "6. Sample Question";
            var Question7 = "7. Sample Question";
            var Question8 = "8. Sample Question";
            var Question9 = "9. Sample Question";
            var Question10 = "10. Sample Question";

            //question options and its solution

            var Answer1a = "3";
            var Answer1b = "5";
            var Answer1c = "2";
            var Answer1d = "4";
            var Answer1Solution = "a";

            var Answer2a = " ";
            var Answer2b = " ";
            var Answer2c = " ";
            var Answer2d = " ";
            var Answer2Solution = " ";

            var Answer3a = " ";
            var Answer3b = " ";
            var Answer3c = " ";
            var Answer3d = " ";
            var Answer3Solution = " ";

            var Answer4a = " ";
            var Answer4b = " ";
            var Answer4c = " ";
            var Answer4d = " ";
            var Answer4Solution = " ";

            var Answer5a = " ";
            var Answer5b = " ";
            var Answer5c = " ";
            var Answer5d = " ";
            var Answer5Solution = " ";

            var Answer6a = " ";
            var Answer6b = " ";
            var Answer6c = " ";
            var Answer6d = " ";
            var Answer6Solution = " ";

            var Answer7a = " ";
            var Answer7b = " ";
            var Answer7c = " ";
            var Answer7d = " ";
            var Answer7Solution = " ";

            var Answer8a = " ";
            var Answer8b = " ";
            var Answer8c = " ";
            var Answer8d = " ";
            var Answer8Solution = " ";

            var Answer9a = " ";
            var Answer9b = " ";
            var Answer9c = " ";
            var Answer9d = " ";
            var Answer9Solution = " ";

            var Answer10a = " ";
            var Answer10b = " ";
            var Answer10c = " ";
            var Answer10d = " ";
            var Answer10Solution = " ";
          
          
            Console.WriteLine(Question1);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer1a, Answer1b, Answer1c, Answer1d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer1 = Console.ReadLine(); //Reads the user's answer
            if (Answer1 == Answer1Solution) //using if statement to check the correct answer
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question2);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer2a, Answer2b, Answer2c, Answer2d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer2 = Console.ReadLine();
            if (Answer2 == Answer2Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question3);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer3a, Answer3b, Answer3c, Answer3d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer3 = Console.ReadLine();
            if (Answer3 == Answer3Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question4);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer4a, Answer4b, Answer4c, Answer4d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer4 = Console.ReadLine();
            if (Answer4 == Answer4Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question5);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer5a, Answer5b, Answer5c, Answer5d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer5 = Console.ReadLine();
            if (Answer5 == Answer5Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question6);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer6a, Answer6b, Answer6c, Answer6d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer6 = Console.ReadLine();
            if (Answer6 == Answer6Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question7);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer7a, Answer7b, Answer7c, Answer7d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer7 = Console.ReadLine();
            if (Answer7 == Answer7Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question8);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer8a, Answer8b, Answer8c, Answer8d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer8 = Console.ReadLine();
            if (Answer8 == Answer8Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question9);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer9a, Answer9b, Answer9c, Answer9d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer9 = Console.ReadLine();
            if (Answer9 == Answer9Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.WriteLine(Question10);
            Console.WriteLine("a) {0} b) {1} c) {2} d) {3}", Answer10a, Answer10b, Answer10c, Answer10d);
            Console.WriteLine("Select a, b, c, or d");
            string Answer10 = Console.ReadLine();
            if (Answer10 == Answer10Solution)
            {
                Console.WriteLine("------Correct!------");
                Console.WriteLine(" Next Question...");
            }
            else
            {
                Console.WriteLine("------Wrong!------");
                Console.WriteLine(" Next Question...");
            }

            Console.ReadLine();
        }
    }
}

Output:

Add a comment
Know the answer?
Add Answer to:
C# Sharp for Visual Studio Need Expert help -to use Video studio to write a Quiz....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C #sharp Visual Studio Programming, Implement the array declaration and initialization for -For this quiz I...

    C #sharp Visual Studio Programming, Implement the array declaration and initialization for -For this quiz I attached (EXAMPLE of 10 questions).... Using arrays to format this quiz? using System; namespace Quiz {     class MainClass     {         public static void Main(string[] args)         {             Console.WriteLine("Welcome to the Quiz!");             Console.WriteLine("--------------------------------");             Console.WriteLine(" ");             //Questions                       var Question1 = "1. How many trees in a forest?";             var Question2 = "2. Sample Question";             var Question3 =...

  • for my assignment, we have to create a basic quiz on c sharp using visual studio,...

    for my assignment, we have to create a basic quiz on c sharp using visual studio, i have my questions, gotten the score calculated if answered correct or not. but in having issues with looping back to the question until answered right.

  • So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I...

    So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I need help editing my code. I want my quiz to clear the screen after each question. It should do one question at a time and then give a retry of each question that was wrong. The right answer should appear if the retry is wrong. After the 1 retry of each question, a grade should appear. Please note and explain the changes you make...

  • (C#, Visual Studio) I need help modifying my program code to accommodate repeated numbers. For example,...

    (C#, Visual Studio) I need help modifying my program code to accommodate repeated numbers. For example, if a user inputs a repeated number the program should regenerate or ask to enter again. If needed, here is the program requirements: Create a lottery game application. Generate four random numbers, each between 1 and 10. Allow the user to guess four numbers. Compare each of the user’s guesses to the four random numbers and display a message that includes the user’s guess,...

  • Please write below code in C++ using Visual Studio. Write program that uses a class template...

    Please write below code in C++ using Visual Studio. Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) • Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 • Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the...

  • I need help figuring out how to code this in C++ in Visual Studio. Problem Statement:...

    I need help figuring out how to code this in C++ in Visual Studio. Problem Statement: Open the rule document for the game LCR Rules Dice Game. Develop the code, use commenting to describe your code and practice debugging if you run into errors. Submit source code. Use the document to write rules for the user on how to play the game in a text file. Then, using the information from the resource articles, create a program that will read...

  • This a lab for C++ using visual studio 2017 Lab 10 Total 50 points Stacks and...

    This a lab for C++ using visual studio 2017 Lab 10 Total 50 points Stacks and Queues - Part A (40 points) Finish the code for Lab10aStacksAndQueues.cpp . You will write code for the same function which will return true if the values of the elements of the vector that is passed to it are the same read both forwards and backwards. If they are not the same in both directions, it will return false. Don’t change anything in the...

  • I need help solving this in c++ using visual Studio. For this assignment, you will be filling in missing pieces of code within a program, follow the comments in the code. These comments will describe...

    I need help solving this in c++ using visual Studio. For this assignment, you will be filling in missing pieces of code within a program, follow the comments in the code. These comments will describe the missing portion. As you write in your code, be sure to use appropriate comments to describe your work. After you have finished, test the code by compiling it and running the program, then turn in your finished source code. // TicTacToe.cpp: Follow along with...

  • Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for...

    Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for program with ALL conditions met. Conditions to be met: Word Problem A person inherits a large amount of money. The person wants to invest it. He also has to withdraw it annually. How many years will it take him/her to spend all of the investment that earns at a 7% annual interest rate? Note that he/she needs to withdraw $40,000.00 a year. Also there...

  • Please use Visual Studio! Let me know if you need anything else <3 #include <stdio.h> #include...

    Please use Visual Studio! Let me know if you need anything else <3 #include <stdio.h> #include <string.h> #pragma warning(disable : 4996) // compiler directive for Visual Studio only // Read before you start: // You are given a partially complete program. Complete the functions in order for this program to work successfully. // All instructions are given above the required functions, please read them and follow them carefully. // You shoud not modify the function return types or parameters. //...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT