Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Original question: Write a quiz program on a topic, about which you are knowledgeable. This quiz can be work related, general knowledge or any set

Original question:

Write a quiz program on a topic, about which you are knowledgeable. 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.

This is what I did last week.

This week, you will optimize the existing project code by implementing methods. Additionally, you will test the code for non-permissible input value(s) of the variable(s) and document your test results. Improve your code by adding a statement that displays an error message.

My work for last week

using System;

namespace michaelproject { class Program { static void Questionone() { Console.Write("Q1) Russia is the largest country in terms of land area. 1) True 2) False "); }

static void Questiontwo() { Console.Write("Q2) In terms of land area, what is the smallest country in the world? 1) Vatican City 2) Singapore 3) Fiji 4) Monaco "); }

static void Questionthree() { Console.Write("Q3) Mount Kilimanjaro is the tallest mountain in Africa. 1) True 2) False "); }

static void Questionfour() { Console.Write("Q4) Which country has the most volcanoes in the world? 1) Indonesia 2) Japan 3) Argentina 4) United States of America "); }

static void Questionfive() { Console.Write("Q5) Asia is the largest continent in the world. 1) True 2) False "); }

static void Questionsix() { Console.Write("Q6) Which country has the most island in Asia? 1) Philipphines 2) Japan 3) Indonesia 4) China "); }

static void Questionseven() { Console.Write("Q7) What is the capital city of Canada? 1) Ontario 2) Ottawa 3) Quebec City 4) Montreal "); }

static void Questioneight() { Console.Write("Q8) The Nile is the longest river in the world. 1) True 2) False "); }

static void Questionnine() { Console.Write("Q9) India is the most populous country in 2017. 1) True 2) False "); }

static void Questionten() { Console.Write("Q10) St. Petersburg is the capital city of Russia. 1) True 2) False "); }

static void Main(string[] args) { int answer1; int answer2; int answer3; int answer4; int answer5; int answer6; int answer7; int answer8; int answer9; int answer10; int answer11; int answer12; int answer13; int answer14; int answer15; int answer16; int answer17; int answer18; int answer19; int answer20;

Console.WriteLine("General Knowlegde Test"); Console.WriteLine("Please answer by typing in a number. After entering your answer, press enter once."); Console.WriteLine("Enter to begin the test."); Console.ReadLine();

Questionone(); answer1 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message1 = (answer1 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message1); Console.WriteLine(); if (answer1 > 2) { Console.WriteLine("Error!"); }

Questiontwo(); answer2 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message2 = (answer2 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message2); Console.WriteLine(); if (answer2 > 4) { Console.WriteLine("Error!"); }

Questionthree(); answer3 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message3 = (answer3 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message3); Console.WriteLine(); if (answer3 > 2) { Console.WriteLine("Error!"); }

Questionfour(); answer4 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message4 = (answer4 != 4) ? "Incorrect" : "Correct"; Console.WriteLine(message4); Console.WriteLine(); if (answer4 > 4) { Console.WriteLine("Error!"); }

Questionfive(); answer5 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message5 = (answer5 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message5); Console.WriteLine(); if (answer5 > 2) { Console.WriteLine("Error!"); }

Questionsix(); answer6 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message6 = (answer6 != 3) ? "Incorrect" : "Correct"; Console.WriteLine(message6); Console.WriteLine(); if (answer6 > 4) { Console.WriteLine("Error!"); }

Questionseven(); answer7 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message7 = (answer7 != 2) ? "Incorrect" : "Correct"; Console.WriteLine(message7); Console.WriteLine(); if (answer7 > 4) { Console.WriteLine("Error!"); }

Questioneight(); answer8 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message8 = (answer8 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message8); Console.WriteLine(); if (answer8 > 2) { Console.WriteLine("Error!"); }

Questionnine(); answer9 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message9 = (answer9 != 2) ? "Incorrect" : "Correct"; Console.WriteLine(message9); Console.WriteLine(); if (answer9 > 2) { Console.WriteLine("Error!"); }

Questionten(); answer10 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message10 = (answer10 != 2) ? "Incorrect" : "Correct"; Console.WriteLine(message10); Console.WriteLine(); if (answer10 > 2) { Console.WriteLine("Error!"); }

for (; answer1 != 1;) { Questionone(); answer11 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message11 = (answer11 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message11); Console.WriteLine(); if (answer11 > 2) { Console.WriteLine("Error!"); } break; }

for (; answer2 != 1;) { Questiontwo(); answer12 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message12 = (answer12 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message12); Console.WriteLine(); if (answer12 > 4) { Console.WriteLine("Error!"); } break; }

for (; answer3 != 1;) { Questionthree(); answer13 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message13 = (answer13 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message13); Console.WriteLine(); if (answer13 > 2) { Console.WriteLine("Error!"); } break; }

for (; answer4 != 4;) { Questionfour(); answer14 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message14 = (answer14 != 4) ? "Incorrect" : "Correct"; Console.WriteLine(message14); Console.WriteLine(); if (answer14 > 4) { Console.WriteLine("Error!"); } break; }

for (; answer5 != 1;) { Questionfive(); answer15 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message15 = (answer15 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message15); Console.WriteLine(); if (answer15 > 2) { Console.WriteLine("Error!"); } break; }

for (; answer6 != 3;) { Questionsix(); answer16 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message16 = (answer16 != 3) ? "Incorrect" : "Correct"; Console.WriteLine(message16); Console.WriteLine(); if (answer16 > 4) { Console.WriteLine("Error!"); } break; }

for (; answer7 != 2;) { Questionseven(); answer17 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message17 = (answer17 != 2) ? "Incorrect" : "Correct"; Console.WriteLine(message17); Console.WriteLine(); if (answer17 > 4) { Console.WriteLine("Error!"); } break; }

for (; answer8 != 1;) { Questioneight(); answer18 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message18 = (answer18 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message18); Console.WriteLine(); if (answer18 > 2) { Console.WriteLine("Error!"); } break; }

for (; answer9 != 2;) { Questionnine(); answer19 = Convert.ToInt32(Console.ReadLine()); if (answer19 > 2) Console.WriteLine(); String message19 = (answer19 != 2) ? "Incorrect" : "Correct"; Console.WriteLine(message19); Console.WriteLine(); { Console.WriteLine("Error!"); } break; }

for (; answer10 != 2;) { Questionten(); answer20 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); String message20 = (answer20 != 2) ? "Incorrect" : "Correct"; Console.WriteLine(message20); Console.WriteLine(); if (answer20 > 2) { Console.WriteLine("Error!"); } break; }

}

} }

This is what I need to do this week ( what I need Help for)

This week, you will create an object-oriented model for your project. You will learn to identify and describe the classes, their attributes and operations, as well as the relations between the classes. Create a class diagram using free online UML software of your choice (for example, Creately (Links to an external site.)Links to an external site.). Document the results of your work.

I dont know how to accomplish the taskgiven above.Please help. Thanks!

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

PostgreSQL 10 High Performance Expert Techniques For Query Optimization High Availability And Efficient Database Maintenance

Authors: Ibrar Ahmed ,Gregory Smith ,Enrico Pirozzi

3rd Edition

1788474481, 978-1788474481

More Books

Students also viewed these Databases questions