Write a Java Program which includes at least 6 different questions with 4 Multiple Choice Options. Ask the User to choose one answer from those 4 choices. You can implement the MCQs with RadioButton Class of Swing Package. After answering all the answer by the user your program should be able to compare user answer with the already saved corrected answers and shows the percentage of the total corrected answers. /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cal; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; /** * * @author Ali */ public class RadioDem extends JFrame implements ActionListener{ JButton btnsubmit=new JButton("Submit"); JRadioButton b1=new JRadioButton("Red"); JRadioButton b2=new JRadioButton("Blue"); JRadioButton b3=new JRadioButton("Green"); public RadioDem(){ setSize(300,300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(new GridLayout(2,1)); JPanel p1=new JPanel(); p1.setBackground(Color.red); JPanel p2=new JPanel(); p2.setLayout(new GridLayout(5,1)); add(p1); add(p2); JLabel l1=new JLabel("What is the above Color"); ButtonGroup bg=new ButtonGroup(); bg.add(b1); bg.add(b2); bg.add(b3); p2.add(l1); p2.add(b1); p2.add(b2); p2.add(b3); p2.add(btnsubmit); btnsubmit.addActionListener(this); } public static void main(String a[]) { RadioDem gui=new RadioDem(); gui.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("Submit")){ if(b1.isSelected()) JOptionPane.showMessageDialog(this, "Your choie is corrected"); else JOptionPane.showMessageDialog(this, "Your choice is Wrong"); } } }