Engineering

In this project, you will create a class that can tell riddles like the following:- Riddle Question: Why did the chicken cross the playground?- Riddle Answer: To get to the other slide!1. First, brainstorm in pairs to do the Object-Oriented Design for a riddle asking program. What should we call this class? What data does it need to keep track of in instance variables? What is the data type for the instance variables? What methods do we need? (You could draw a Class Diagram for this class using Creately.com, although it is not required).2. Using the Person class above as a guide, write a Riddle class in the Active Code template below that has 2 instance variables for the riddles question and answer, a constructor that initializes the riddle, and 2 methods to ask the riddle and answer the riddle. Hint: Dont name your instance variables initQuestion and initAnswer well explain why shortly. If you came up with other instance variables and methods for this class, you can add those too! Dont forget to specify the private or public access modifiers. Use the outline in the Active Code below. You will learn how to write constructors and other methods in detail in the next lessons.3. Complete the main method to construct at least 2 Riddle objects and call their printQuestion() and printAnswer() methods to ask and answer the riddle. You can look up some good riddles online.4. public class Riddle{// write 2 instance variables for Riddle's question and answer: private type variableName;// constructorpublic Riddle(String initQuestion, String initAnswer){// set the instance variables to the init parameter variables}// Print riddle questionpublic void printQuestion(){// print out the riddle question with System.out.println}// Print riddle answerpublic void printAnswer(){// print out the riddle answer with System.out.println}// main method for testingpublic static void main(String[] args){// call the constructor to create 2 new Riddle objects// call their printQuestion() and printAnswer methods}}