# OMR Evaluation

#### Question :

Teja works as a professor in ANP University. After the exams, he needs to correct the answer
papers of students. First, he prepares the answer key and then he compares the answer key with
the student’s OMR answer paper. Create a Java application and help Prof. Teja to correct the
OMR answer sheets and calculate the marks.

Adhere to the Sample inputs and outputs.

#### Note :

• Get the number of questions as input. It must be a positive number, Else print “Invalid Number” and terminate
• In both the input series – answer key and student answers, Answers must be in between A to E (Case Sensitive and Both inclusive). Otherwise, Print “Invalid Answers” and terminate the program.
• Compare the answer key and Student answers. Find the equal values in same position of both lists. If there is any equal values then print “Correct answers are “. Else print “All answers are wrong”
• For the mark calculation, divide the number of the repeated value by number of the answers and multiply the quotient with 100 and print “Mark is ”

Mark = (correct answer count * 100 ) / Total number of questions

Please do not use System.exit(0) to terminate the program

Assumption: Number of questions cannot be zero

#### Sample Input 1 :

Enter the No of questions
5
A
C
E
B
A
D
A
E
B
C

#### Sample Output 1 :

Mark is 40

Explanation: Position 2 and Position 3 have the same value. 2 answers are correct among the 5. To calculate the mark, mark=(2*100)/5=40. The output is “Correct answers are 2” and “Mark is 40”

#### Sample Input 2 :

Enter the No of questions
4
A
C
D
E
B
A
C
D

Mark is 0

#### Sample Input 3 :

Enter the No of questions
7
a

#### Sample Input 4 :

Enter the No of questions
-1

Invalid Number

#### Question:

```import java.util.Scanner;
public class arraysquare{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int i;
System.out.println("Enter the No of questions");
int a=sc.nextInt();
if(a<0)
{
System.out.println("Invalid Number");
return;
}
int count=0;
int mark=0;
char b[]=new char[a];
for (i=0;i<a;i++) {
b[i] = sc.next().charAt(0);
if ((b[i] >= 'a' && b[i] <= 'e')||(b[i] > 'E')) {
return;
}
}
char c[]=new char[a];
for (i=0;i<a;i++)
{
c[i]=sc.next().charAt(0);
if ((c[i] >= 'a' && c[i] <= 'e')||(b[i]>'E')) {
return;
}
}
for(i=0;i<a;i++)
{
if(b[i]==c[i])
{
count++;
}
}
if(count>0)