
1.Write a program that will grade the students quiz. The program will ask the user to enter the number of the questions in the quiz, the right answer for each question and save it in array. The program will ask the user to enter the student answers to be checked and show the number of right answers and the final grade as a percentage. The program will ask if the user want to grade another quiz.
2Write a program that uses an array of 10 stings. Write methods that carry out each of the following operations: 1 Input from the keyboard via a text field values for all of the components of the array. 2 Display the values. (You can now observe that they have been entered correctly into your array.) 3 Input a word from the keyboard and search to see whether it is present in the array. Display a message to say whether it is present in the array or not.

import javax.swing.*;
public class StringArrayExample{
public static void main(String[]args){
String array[]=new String[10];
for(int i=0;i<array.length;i++){
String st=JOptionPane.showInputDialog(null,"Enter string:"+(i+1));
array[i]=st;
}
System.out.println("Array Elements: ");
for(int i=0;i<array.length;i++){
System.out.println(array[i]);
}
String str=JOptionPane.showInputDialog(null,"Enter word:");
int count=0;
for(int i=0;i<array.length;i++){
if(array[i].equals(str)){
count++;
}
}
if(count>=1){
System.out.println("Word is present in the array!");
}
else{
System.out.println("Not present!");
}
}
}