0% found this document useful (0 votes)
16 views

Java MP-1

Uploaded by

sangharaj5252
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Java MP-1

Uploaded by

sangharaj5252
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Maharashtra State Board of Technical Education, Mumbai

Branch Name : Computer Engineering


Academic Year : 2024-25
Course Name & Code : Advance Java
Programming (22517)
Semester : V

MICROPROJECT TOPIC : Online Class Test Application


Submitted in November 2024 by the Group of TYCO Students

Sr. Roll Name Of the Enrollment Seat


No No. Student No. No.
1 56 Jagtap Sangharaj Vijay 23612590141 515147
2 53 More Siddhi Ananta 2218000092 515143
3 16 Pawar Dhanashree Dilip 2218000037 515106
4 32 Avhad Pratiksha Subhash 2218000061 515122

Under the guidance of


Prof. T.R.Kawade

Three years Diploma programme in Engineering and Technology of Maharashtra


State Board of Technical Education, Mumbai (Autonomus)
IOS 9001:2008 (IOS/IEC – 27001:2013), AT-1800
G. E. S. Sir Dr. M. S. Gosavi Polytechnic Nashik-Road, Nashik – 422101

Prof.T.R.Kawade Prof. T.R.Kawade Dr.S.P.Deshpande


Course Faculty Head Of Department Principal
Maharashtra State Board of Technical Education, Mumbai

Certificate

This is to certify that Jagtap Sangharaj Vijay Roll.No 56 of Computer


Engineering Diploma Programme Engineering & Technology at (1800)
Sir.Dr.M.S.Gosavi Polytechnic Institute,Nashik Road Nashik-422101 has
completed the Micro project statisfactorily in

Subject: Advance Java Programming (22517) in the academic year 2024-2025


as prescribed in the MSBTE curriculum of I Scheme.

Place : Nashik Enrollment no : 23612590141

Date :11 /11/2024 Seat no : 515147

Prof.T.R.Kawade Prof.T.R.Kawade Dr.S.P.Deshpande


Course Faculty Head Of Department Principal
Maharashtra State Board of Technical Education, Mumbai

Certificate

This is to Certify that More Siddhi Ananta Roll.No 53 of Computer


Engineering Diploma Programme Engineering & Technology at (1800)
Sir.Dr.M.S.Gosavi Polytechnic Institute,Nashik Road Nashik-422101 has
completed the Micro project statisfactorily in

Subject: Advance Java Programming (22517) in the academic year 2024-2025


as prescribed in the MSBTE curriculum of I Scheme.

Place : Nashik Enrollment no : 2218000092

Date :11 /11/2024 Seat no : 515143

Prof.T.R.Kawade Prof.T.R.Kawade Dr.S.P.Deshpande


Course Faculty Head Of Department Principal
Maharashtra State Board of Technical Education, Mumbai

Certificate

This is to certify that Pawar Dhanashree Dilip Roll.No 16 of Computer


Engineering Diploma Programme Engineering & Technology at (1800)
Sir.Dr.M.S.Gosavi Polytechnic Institute,Nashik Road Nashik-422101 has
completed the Micro project statisfactorily in

Subject: Advance Java Programming (22517) in the academic year 2024-2025


as prescribed in the MSBTE curriculum of I Scheme.

Place : Nashik Enrollment no : 2218000037

Date :11 /11/2024 Seat no : 515106

Prof.T.R.Kawade Prof.T.R.Kawade Dr.S.P.Deshpande


Course Faculty Head Of Department Principal
Maharashtra State Board of Technical Education, Mumbai

Certificate

This is to certify that Avhad Pratiksha Subhash Roll.No 32 of Computer


Engineering Diploma Programme Engineering & Technology at (1800)
Sir.Dr.M.S.Gosavi Polytechnic Institute,Nashik Road Nashik-422101 has
completed the Micro project statisfactorily in

Subject: Advance Java Programming (22517) in the academic year 2024-2025


as prescribed in the MSBTE curriculum of I Scheme.

Place : Nashik Enrollment no : 2218000061

Date :11 /11/2024 Seat no : 515122

Prof.T.R.Kawade Prof.T.R.Kawade Dr.S.P.Deshpande


Course Faculty Head Of Department Principal
INDEX

Sr.No Contents Page No

1 Introduction

2 Algorithm

3 Program Code

4 Outputs

5 Conclusion
INTRODUCTION
The Online Test App is a simple yet functional Java application designed to simulate a basic online
examination environment. Built using Java Swing, this desktop application provides an intuitive graphical
interface for users to navigate and answer a series of multiple-choice questions (MCQs). It demonstrates
core Java concepts and is specifically targeted toward beginners who want to understand how GUI-based
applications are developed in Java.
Project Objectives:
The primary objective of the project is to implement a multiple-choice test system that allows users to:
View questions and select answers from multiple choices.
Move between questions sequentially using the "Next" button.
Bookmark questions for later review using the "Bookmark" button.
Provide a clean, user-friendly interface for interacting with the test.
The simplicity of this project makes it a perfect tool for educational purposes or small-scale exams that do
not require extensive database support.
Key Features:
 Multiple-choice questions: Each question offers four possible answers. The user can select only one
option, which is recorded for future review.
 Bookmarking feature: The user has the option to bookmark questions. This feature helps in marking
uncertain questions and revisiting them before final submission.
 Sequential navigation: Users can easily move from one question to the next using the “Next” button.
The system ensures that users cannot skip questions but allows them to return to bookmarked ones.
 No Database Dependency: The project is designed to be lightweight and does not use any database
connectivity, making it ideal for demonstrating fundamental Java concepts without adding the
complexity of a backend system.
Java Concepts Explored:
 Swing Framework: To create graphical user interfaces using components such as JFrame, JPanel,
JButton, JRadioButton, and JLabel.
 Event Handling: The core of user interaction is built on event listeners. The app uses event handling
mechanisms to respond to button clicks and record the user's actions.
 Flow Control: The app maintains control over navigation between questions using simple Java
constructs like loops, conditional statements (if-else), and array structures.
 User Experience Design: While simple, the layout is designed to mimic real-world online test
interfaces, focusing on user ease and minimal learning curve.
ALGORITHM
1. Start.
2. Display a question with multiple choices.
3. User selects one option.
4. If the user clicks Next, validate the selected answer:
o If correct, store as correct.
o If incorrect, store as incorrect.
5. If the user clicks Bookmark, save the question for review later without validating the answer.
6. Repeat the above steps until the last question is answered or bookmarked.
7. Display the results (correct, incorrect, and bookmarked questions).
8. End.

FLOW CHART
PROGRAM CODE

package com.gainjava.knowledge;

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.JRadioButton;

class OnlineTest extends JFrame implements ActionListener {

private static final long serialVersionUID = 1L;

JLabel label;

JRadioButton radioButton[] = new JRadioButton[5];

JButton btnNext, btnBookmark;

ButtonGroup bg;

int count = 0, current = 0, x = 1, y = 1, now = 0;

int m[] = new int[10];

// create jFrame with radioButton and JButton

OnlineTest(String s) {

super(s);

label = new JLabel();

add(label);

bg = new ButtonGroup();

for (int i = 0; i < 5; i++) {

radioButton[i] = new JRadioButton();

add(radioButton[i]);
bg.add(radioButton[i]);

btnNext = new JButton("Next");

btnBookmark = new JButton("Bookmark");

btnNext.addActionListener(this);

btnBookmark.addActionListener(this);

add(btnNext);

add(btnBookmark);

set();

label.setBounds(30, 40, 450, 20);

//radioButton[0].setBounds(50, 80, 200, 20);

radioButton[0].setBounds(50, 80, 450, 20);

radioButton[1].setBounds(50, 110, 200, 20);

radioButton[2].setBounds(50, 140, 200, 20);

radioButton[3].setBounds(50, 170, 200, 20);

btnNext.setBounds(100, 240, 100, 30);

btnBookmark.setBounds(270, 240, 100, 30);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(null);

setLocation(250, 100);

setVisible(true);

setSize(600, 350);

// handle all actions based on event

public void actionPerformed(ActionEvent e) {

if (e.getSource() == btnNext) {

if (check())

count = count + 1;

current++;

set();

if (current == 9) {

btnNext.setEnabled(false);

btnBookmark.setText("Result");

}
if (e.getActionCommand().equals("Bookmark")) {

JButton bk = new JButton("Bookmark" + x);

bk.setBounds(480, 20 + 30 * x, 100, 30);

add(bk);

bk.addActionListener(this);

m[x] = current;

x++;

current++;

set();

if (current == 9)

btnBookmark.setText("Result");

setVisible(false);

setVisible(true);

for (int i = 0, y = 1; i < x; i++, y++) {

if (e.getActionCommand().equals("Bookmark" + y)) {

if (check())

count = count + 1;

now = current;

current = m[y];

set();

((JButton) e.getSource()).setEnabled(false);

current = now;

if (e.getActionCommand().equals("Result")) {

if (check())

count = count + 1;

current++;

JOptionPane.showMessageDialog(this, "correct answers= " + count);

System.exit(0);

// SET Questions with options


void set() {

radioButton[4].setSelected(true);

if (current == 0) {

label.setText("Que1: Give The Abbreviation Of AWT?");

radioButton[0].setText("Applet Windowing Toolkit");

radioButton[1].setText("Abstract Windowing Toolkit");

radioButton[2].setText("Absolute Windowing Toolkit");

radioButton[3].setText("None Of The Above");

if (current == 1) {

label.setText("Que2: AWT is used for GUI Programming in JAVA?");

radioButton[0].setText("True");

radioButton[1].setText("False");

if (current == 2) {

label.setText("Que3: By Which Method You Can Set Or Change the Text in Label?");

radioButton[0].setText("setText()");

radioButton[1].setText("getText()");

radioButton[2].setText("Both 1 & 2");

radioButton[3].setText("None of The Above");

if (current == 3) {

label.setText("Que4: What is API?");

radioButton[0].setText("Application Programming Interchange");

radioButton[1].setText("Application Programming Interaction");

radioButton[2].setText("Application Programming Interface");

radioButton[3].setText("None of The Above");

if (current == 4) {

label.setText("Que5: Public Class MenuBar extends _____.");

radioButton[0].setText("MenuComponent");

radioButton[1].setText("MenuContainer");

radioButton[2].setText("ComponentMenu");

radioButton[3].setText("MenuBar");

if (current == 5) {
label.setText("Que6: What is The Default Layout for DialogBox?");

radioButton[0].setText("FlowLayout");

radioButton[1].setText("GridLayout");

radioButton[2].setText("CardLayout");

radioButton[3].setText("BorderLayout");

if (current == 6) {

label.setText("Que7: Which Class Define setSize() Method?");

radioButton[0].setText("Frame");

radioButton[1].setText("Applet");

radioButton[2].setText("Component");

radioButton[3].setText("Panel");

if (current == 7) {

label.setText("Que8: Current text of Label Obtained Using ____.");

radioButton[0].setText("setAlignment()");

radioButton[1].setText("getAlignment()");

radioButton[2].setText("getText()");

radioButton[3].setText("SetText()");

if (current == 8) {

label.setText("Que9: ");

radioButton[0].setText("true");

radioButton[1].setText("false");

radioButton[2].setText("don't know");

radioButton[3].setText("false");

if (current == 9) {

label.setText("Que10: Which of the following is not a state of object in Hibernate?");

radioButton[0].setText("Attached()");

radioButton[1].setText("Detached()");

radioButton[2].setText("Persistent()");

radioButton[3].setText("Transient()");

label.setBounds(30, 40, 450, 20);

for (int i = 0, j = 0; i <= 90; i += 30, j++)


radioButton[j].setBounds(50, 80 + i, 200, 20);

// declare right answers.

boolean check() {

if (current == 0)

return (radioButton[1].isSelected());

if (current == 1)

return (radioButton[1].isSelected());

if (current == 2)

return (radioButton[0].isSelected());

if (current == 3)

return (radioButton[2].isSelected());

if (current == 4)

return (radioButton[0].isSelected());

if (current == 5)

return (radioButton[0].isSelected());

if (current == 6)

return (radioButton[1].isSelected());

if (current == 7)

return (radioButton[2].isSelected());

if (current == 8)

return (radioButton[0].isSelected());

if (current == 9)

return (radioButton[0].isSelected());

return false;

public static void main(String s[]) {

new OnlineTest("Online Test App");

}
OUTPUTS
CONCLUSION

The "Online Test" application showcases the effective use of Advanced Java concepts to build interactive,
dynamic, and reliable systems. By leveraging technologies such as Servlets, JSP, JDBC, and session
management, this project demonstrates how Advanced Java can be used to create web-based solutions that
address real-world challenges.
This application streamlines the process of conducting assessments, providing features like secure user
authentication, randomization of questions, real-time test submission, and automated result calculation. The
use of a structured database enhances the application's efficiency and reliability, ensuring smooth data
management.
Through this project, we understand the significance of Advanced Java in creating enterprise-level web
applications. It emphasizes the role of Java in developing scalable, secure, and user-friendly platforms,
making it an essential skill set for modern software development. The Online Test project stands as a
testament to how Advanced Java can transform traditional processes into more accessible and automated
solutions.
• MARKS SECTION :

Sr. Seat Name Of the Group Presentation Total


No No. Student Activity (6 Activity (4 (10
Marks) Marks) Marks)
1 515147 Jagtap Sangharaj Vijay
2 515143 More Siddhi Ananta
3 515106 Pawar Dhanashree Dilip
4 515122 Avhad Pratiksha Subhash

Prof.T.R.Kawade
Department of Computer Engineering
Dr.M.S Gosavi Polytechnic Nashik Road Nashik(1800) – 422101

You might also like