Answered You can hire a professional tutor to get the answer.

QUESTION

Question: From the code listed below, I need to refine it to be more efficient, correct so it will run, and to do the following: Implement the array...

Question:From the code listed below, I need to refine it to be more efficient, correct so it will run, and to do the following:

  1. Implement the array declaration and initialization.
  2. Implement the access to the elements of an array using the subscript operator.
  3. Perform the output of the elements of an array to the Console.
  4. Examine one-dimensional and two-dimensional arrays.
  5. Distinguish the action-oriented and the object-oriented approaches to programming.
  6. Implement the method declaration, implementation, and invocation.
  7. Analyze the parameter-passing mechanisms when implementing a method.

And also - implement repetitive tasks of your algorithm while using conditional and iteration statements in C#. Implement the loop option that suits best your project. Test the code for different input values of the variable(s) to include the out-of-range values. Add a statement that displays an error message. Document the test results.

using System;

/**

Filename: ENGR115Module1Quiz

Written by: Johan Nikolai

Date: 2018

This program contains a quiz of 10 questions related to coffee

*/

public class ENGR115Module1Quiz { static void Main() { System.Console.WriteLine("Hello C#!"); } }

public static void Questionone()

   {

   Console.Write("Q1) Coffee beans grow on?n1) A low vinen2) Bushn3) Treen4) Coffee plantn");

   int answer1 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message1 = (answer1 != 3) ? "Incorrect" : "Correct";

   Console.WriteLine(message1);

}

public static void Questiontwo()

{

   Console.Write("Q2) Most coffees are a blend of?n1) Light and dark roastsn2) Arabica and robusta beansn3) Caffeine and essential oilsn4) African and South American beansn");

   int answer2 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message2 = (answer2 != 2) ? "Incorrect" : "Correct";

   Console.WriteLine(message2);

}

public static void Questionthree()

{

   Console.Write("Q3) What is an ibrik is?n1) Grinding tooln2) Turkish word for baristan3) Middle Eastern coffeehousen4) Copper pot for making Turkish coffeen");

   int answer3 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message3 = (answer3 != 1) ? "Incorrect" : "Correct";

   Console.WriteLine(message3);

}

public static void Questionfour()

{

   Console.Write("Q4) Arabica varieties such as Java and Mocha are named after?n1) Plantationsn2) Coffee growern3) Flavoringsn4) Ports of originn");

   int answer4 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message4 = (answer4 != 4) ? "Incorrect" : "Correct";

   Console.WriteLine(message4);

}

public static void Questionfive()

{

   Console.Write("Q5) sixteenth century Muslim rulers banned coffee because of?n1) Stimulating effectsn2) Gambling in coffeehousesn3) Black market in coffee traden4) Coffee limited to spiritual ceremoniesn");

   int answer5 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message5 = (answer5 != 1) ? "Incorrect" : "Correct";

   Console.WriteLine(message5);

}

public static void Questionsix()

{

   Console.Write("Q6) Kopi Luwak the world's most expensive coffee?n1) Processed during a full moonn2) Brewed in solid gold potsn3) Grown at a higher altitude than other beansn4) Coffee beans eaten and then excreted by a Sumatran wild catn");

   int answer6 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message6 = (answer6 != 4) ? "Incorrect" : "Correct";

   Console.WriteLine(message6);

}

public static void Questionseven()

{

   Console.Write("Q7) coffee is actually a fruit.n1) Truen2) Falsen");

   int answer7 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message7 = (answer7 != 1) ? "Incorrect" : "Correct";

   Console.WriteLine(message7);

}

public static void Questioneight()

{

   Console.Write("Q8) coffee stays warmer when you add cream.n1) Truen2) Falsen");

   int answer8 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message8 = (answer8 != 1) ? "Incorrect" : "Correct";

   Console.WriteLine(message8);

}

public static void Questionnine()

{

   Console.Write("Q9) george washington invented instant coffee.n1) Truen2) Falsen");

   int answer9 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message9 = (answer9 != 1) ? "Incorrect" : "Correct";

   Console.WriteLine(message9);

}

public static void Questionten()

{

   Console.Write("Q10) dark roast coffees have less caffeine than lighter roasts.n1) Truen2) Falsen");

   int answer10 = Convert.ToInt32(Console.ReadLine());

   Console.ReadKey();

   String message10 = (answer10 != 1) ? "Incorrect" : "Correct";

   Console.WriteLine(message10);

}

public static void Main(string[] args)

{

   Console.Write("Name: MenCourse: my coursenAssignment title: My QuiznTo answer enter the number of your choice then press enter, then any button.n");

   Questionone();

   Questiontwo();

   Questionthree();

   Questionfour();

   Questionfive();

   Questionsix();

   Questionseven();

   Questioneight();

   Questionnine();

   Questionten();

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question