How to covenvert the below questions into SQL Insert Statement using regular expression
QUESTION 31
What is the purpose of the Identify Design Mechanisms activity?
A. to refine the analysis mechanisms and specify the exact implementation of the mechanism
B. to provide a conceptual set of services that is used by analysis objects
C. to refine analysis mechanisms into design mechanisms, based on the constraints imposed by the implementation environment
D. to define design placeholders in the architecture so the architecting effort remains focused and is less likely to become sidetracked
Answer: C
Tech detail required in regular expression :
1.Create a class
2.Find match for required string
3.Read line and store in class
Logic :
Read Line till the EOF
Find Question :
Check for the word “Question “ and a “Numeric Value”.
If true then split question and Question Number by using “Question Symbol” or “A.”.
Find Answer description :
Continue reading lines and splits answers by using “A.”. “B.”. “C.”. “D.”. until it finds a word with “Answer:”
Find Answer :
Split the line which contains Answer: into the words Answer: and Answers Symbols.
Note : Multiple answers considered as same word.
Assumption In multiple choice questions answer notation are stored in Sorted order.
Class Question
{
int question_topic;
int question_number;
String question;
}
Class Answers
{
int question_topic;
int question_number;
String answer;
String correct_answer;
}
Tech Detail :
Parse Question :
Set int question_topic; int question_number; String question; into Question Object
Answer : Looping till find “Answer:” and Parse Answers :
set int question_topic; int question_number; String answer; String correct_answer; into Answers object.
Notes :
1 to many
Has a
Composite
Approach 1 :
read line by line.
Issue :
If question contains more than one line It won't handled
Approach 2 :
Read Question by question
Analyse :
How to read question by question
Issue :
If question contains more than one line It won't handled
Approach 3 :
read line by until it a question completes. Use String tokeniser, string existence and manipulate
No comments:
Post a Comment