Related Posts

This Post Has 10 Comments

  1. Ok for one quit exaggerating about oh no im gonna get kick on the soccer team its my "passion". I dont think anyone cares i certainly dont. And two im only answering this cuz i want points. So,  ✌️

  2. Kindly note that, you're to replace "at" with shift 2 as the text editor can't take the symbol

    Explanation:

    1) Question interface:

    package chegg;

    public interface Question {

       public String getTheQuestionText();

       public boolean isCorrectAnswer(String answer);

     

     public String getCorrectAnswer();

    }

    2) MultipleChoiceQuestion class:

    package chegg;

    public class MultipleChoiceQuestion implements Question {

       private String que;

       private String ans;

       public MultipleChoiceQuestion(String que, String ans) {

           this.que = que;

           this.ans = ans;

       }

       "at"Override

       public String getTheQuestionText() {

           return que;

       }

       "at"Override

       public boolean isCorrectAnswer(String answer) {

           if (ans.equals(answer)) return true;

           else return false;

       }

       "at"Override

       public String getCorrectAnswer() {

           return ans;

       }

    }

    3) TrueFalseQuestion class:

    package chegg;

    public class TrueFalseQuestion implements Question {

       private String que;

       private String ans;

       public TrueFalseQuestion(String que, String ans) {

           this.que = que;

           this.ans = ans;

       }

       "at"Override

       public String getTheQuestionText() {

           return que;

       }

       "at"Override

       public boolean isCorrectAnswer(String answer) {

           if (ans.equals(answer)) return true;

           else return false;

       }

       "at"Override

       public String getCorrectAnswer() {

           return ans;

       }

    }

    4) ShortAnswerQuestion class:

    package chegg;

    public class ShortAnswerQuestion implements Question {

       private String que;

       private String ans;

       public ShortAnswerQuestion(String que, String ans) {

           this.que = que;

           this.ans = ans;

       }

       "at"Override

       public String getTheQuestionText() {

           return que;

       }

       "at"Override

       public boolean isCorrectAnswer(String answer) {

           if (ans.equals(answer)) return true;

           else return false;

       }

       "at"Override

       public String getCorrectAnswer() {

           return ans;

       }

    }

    5) Quiz class:

    package chegg;

    import java.util.ArrayList;

    import java.util.Scanner;

    public class Quiz {

       private ArrayList<Question> questions;

       private ArrayList<Question> wrong;

       public Quiz(){

           questions = new ArrayList<>();

       }

       public void addQuestion(Question q){

           questions.add(q);

       }

       public double giveQuiz(){

           Scanner sc = new Scanner(System.in);

           int total = questions.size();

           int marks = 0;

           wrong = new ArrayList<>();

           for(int i=0; i<total; i++){

               Question q = questions.get(i);

               System.out.println("Question no. "+i+": "+q.getTheQuestionText());

               System.out.println("your ");

               String ans = sc.next();

               if(q.isCorrectAnswer(ans)) marks++;

               else wrong.add(q);

           }

           double score = marks*100/(double)total;     // score in percentage

           return score;

       }

       public void showWrongAnswer(){

           System.out.println("Solutions to your wrong answers: ");

           for (Question q: wrong){

               System.out.println("Question: "+q.getTheQuestionText());

               System.out.println(" "+q.getCorrectAnswer());

           }

       }

    }

    6) QuizTime class:

    package chegg;

    import java.util.Scanner;

    public class QuizTime {

       public static void main(String[] args) {

           Scanner sc = new Scanner(System.in);

           System.out.println("Enter number of questions: ");

           int n = sc.nextInt();

           System.out.println("Please choose type of question (enter 1, 2 or 3) : ");

           System.out.println("1. Multiple choice question");

           System.out.println("2. True or False type question");

           System.out.println("3. Short answer question");

           int choice = sc.nextInt();

           Quiz quiz = new Quiz();

           while (n>0){

               System.out.println("Enter question: ");

               String q = sc.next();

               System.out.println("Enter ");

               String ans = sc.next();

               Question question;

               if (choice == 1) question = new MultipleChoiceQuestion(q, ans);

               else if (choice == 2) question = new TrueFalseQuestion(q,  ans);

               else question = new ShortAnswerQuestion(q, ans);

               quiz.addQuestion(question);

               n--;

           }

           System.out.println("Give the following test: ");

           if (choice == 1) System.out.println("Note: all questions are Multiple choice question");

           else if (choice == 2) System.out.println("Note: all questions are True or False type question");

           else System.out.println("Note: all questions are Short answer question");

           double score = quiz.giveQuiz();

           System.out.println("your final score is: "+score+"%");

           quiz.showWrongAnswer();

       }

    }

  3. Them Decks when crazy

    A lunar eclipse can only occur at the time of Full Moon.

    another is 1) were treated badly

    The Middle Passage was the most infamous route of this triangular trade. Although danger lurked constantly throughout the voyage across the Atlantic, the greatest danger to the slave ships always came when they were loading on the African coast. Once aboard the ships, the negroes realized that they were being sent far away from home, and often there was violence even before the ship set sail. However, most of these uprisings were easily put down. Others jumped overboard and plunged from the ship into the sea, choosing to either drown or be devoured by blood-thirsty sharks rather than be taken from their homeland. P2. is in comments.

    By the middle of the 16th century more than 10,000 Africans a year were being sold to the European colonists in the West Indies. Portuguese ships were the first to engage in the slave traffic, but it was not long before Spanish, French, Dutch, and English slavers took it up.

    Once aboard the ships the blacks would be packed below deck. Captains of slave ships were known as either "loose packers" or "tight packers", depending upon how many slaves they crammed into the space they had. Most ships, especially those of the later 18th century, were "tight packers", carrying a huge quantity of

    slaves who were often forced to lie in spaces smaller than that of a grave, or in some cases stacked spoon-fashion on top of one another. Regardless, life for a slave in the "tween decks", as they were called, was extremely uncomfortable. In addition to extreme overcrowding, there was also inadequate ventilation, not to mention little or no sanitation. Although some captains would have their crew

    http://www.mrcapwebpage.com/VCSUSHISTORY/middlepassageblackgold.html Here is the site I can't put the whole passage in at once

Leave a Reply

Your email address will not be published. Required fields are marked *