Java Micro Project
Java Micro Project
A Project Reports on
“ROCK PAPER SCISSORS GAME”
DIPLOMA
In
COMPUTER ENGINEERING
Submitted by
Certificate
This is to Certify that the following students of IV semester of Diploma in
COMPUTER ENGINEERING of Institute SANT GAJANAN MAHARAJ
RURAL POLYTECHNIC MAHAGAON-416503. (CODE-0965) has
completed Micro-
project on “Rock Paper Scissors Game” satisfactory in subject Java
Programming subject code 22412 for academic year 2022 to 2023 as prescribed
in the curriculum.
Sr Content Page
No. No.
1-2
1. Part A Micro project proposal
3-4
2. Part B Micro project Report
5-9
3. Introduction to JAVA
10
4. Runtime Environment Specifications
11-13
5. Source Code
6. Output 14
Introduction:
Rock paper scissors (also known by other orderings of the three items, with "rock" sometimes being called
"stone," or as Rochambeau, roshambo, or ro-sham-bo) is an intransitive hand game, usually played between two
people, in which each player simultaneously forms one of three shapes with an outstretched hand. These shapes
are "rock" (a closed fist), "paper" (a flat hand), and "scissors" (a fist with the index finger and middle finger
extended, forming a V).
A simultaneous, zero-sum game, it has three possible outcomes: a draw, a win or a loss. A player who decides
to play rock will beat another player who has chosen scissors ("rock crushes scissors" or "breaks scissors" or
sometimes "blunts scissors"), but will lose to one who has played paper ("paper covers rock"); a play of paper
will lose to a play of scissors ("scissors cuts paper"). If both players choose the same shape, the game is tied and
is usually immediately replayed to break the tie.
Rock paper scissors is often used as a fair choosing method between two people, similar to coin flipping,
drawing straws, or throwing dice in order to settle a dispute or make an unbiased group decision. Unlike
truly random selection methods, however, rock paper scissors can be played with a degree of skill by
recognizing and exploiting non-random behavior in opponents.
Rock Paper Scissors is an intransitive hand game, usually played between two people, in which each
player simultaneously forms one of three shapes with an outstretched hand. Rock paper scissors is often
used as a fair choosing method between two people, similar to coin flipping, drawing straws, or throwing
dice in order to settle a dispute or make an unbiased group decision. Unlike truly random selection
methods, however, rock paper scissors can be played with a degree of skill by recognizing and exploiting
non-random behavior in opponents.
We have converted this intransitive game into single player game with Computer if we are deciding
which optional we have to select in such cases we use this game to make decision.
4.0 Literature Review:-
In the literature review we consider and examine the work done by other scholars and researchers who
have broached on this particular topic (Rock Paper Scissors Game )Technology has made a
considerable impact on the gaming industry in recent years and will continue to do so with the
increasing use of computer, technology has become far more advanced and far more widely used
throughout all types of industry.
Indeed, many gamers rely on technological systems for the vast majority of their operations. They
use a range of computer programs from everything to playing, communications, security and
payments. If games do not use some sort of advanced technological system in its operations, it is
deemed to be out of date and disorganized.
Software requirements
1. JDK 1.7
• Eclipse 8.0
2. Database
• mysql-connector-java-5.1.22-bin.jar
4. Operating System
1.0 Rational:-
Talking about the system, it lacks one basic thing that is the login panel for the developer. You
can simply add the login panel to make it more secure and private. The game is all from the
developer side. Developer has the full access to the game. The gamer can only play. The user can
either use top-up which is paid, or use community version of game for later confirmation or
simply can play. After that, then the user can give as rating which helps to improve
The gaming industry is the perfect test bed for new technologies, techniques, and tools in software
development. Many key advances in the software field such as path finding AI, search algorithms, and
VR/AR hardware integrations come first from gaming. The Field’s unique ability to try out new
languages and tools in such a creative and diverse discipline makes it well suited to trial and
experimentation.
In many games, it is common for a group of possible choices to interact in a rock paper
scissors style, where each selection is strong against a particular choice, but weak against
another. Such mechanics can make a game somewhat self-balancing, prevent gameplay from
being overwhelmed by a single dominant strategy and single dominant type of unit.
5.0Literature Review:-
It is clear that technology used in gaming industry is also used to make customers’ lives more
convenient. Peacock notes “gaming enterprises will become an increasing feature of the
industry, particularly at the budget end of the market
6.0 Acknowledgement:-
I have taken efforts in this project. However, it would not have been possible without the kind support
and help of many individuals and organizations. I would like to extend my sincere thanks to all of
them. I am highly indebted to A. T. Narvekar sir, for their guidance and constant supervision as well
as for providing necessary information regarding the project &also for their support in completing the
project. I would like to express my gratitude towards my parents & member of our project team for
Their kind co-operation and encouragement which help me in completion of this project. I would like
to express my special gratitude and thanks to industry persons for giving me such attention and time.
My thanks and appreciations also go to my colleague in developing the project and people who have
willingly helped me out with their abilities.
ABSTRACT:-
This project aims at creating on Rock Paper Scissors game which can be used by gamer. The
developers to advise/publish the availability of game in different store like PlayStore, AppStore and
customers are download the game. Customers should be able to know the how to play the game for
that we will provide Training in the game.
They should be able to reserve the game according to their need in advance to make the game more
improved they can rate us on playstore and appstore. The developer hands the game information of
customers. The users can register and log into the system. The developer will know the details of
reservation and daily income. The rock paper scissors game maintains the user information details in
certain database. This project provides security to gamer which plays it.
Introduction to JAVA :-
Java is a programming language originally developed by James Gosling at Sun Microsystems
(which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of
Sun Micro-systems Java platform. The language derives much of its syntax from C and C++ but
has as interpreter object model and fewer low-level facilities. Java applications are typically
compiled to byte code (.class file) that can run on any Java Virtual Machine (JVM) regardless of
computer architecture. Java is a general-purpose, concurrent, class-based, object-oriented
language that is specifically designed to have as few implementation dependencies as possible.
It is intended to let application developers" write once, run anywhere". Java is currently one of
the most popular programming languages in use, and is widely used from application software
to web applications.
Principles:-
There were five primary goals in the creation of the Java language
It should be "simple, object-oriented and familiar".
It should be "robust and secure".
It should be "architecture-neutral and portable".
It should execute with "high performance".
It should be "interpreted, threaded, and dynamic".
Java is a fully Object Oriented language because object is at the outermost level of data
structure in Java.
No standalone methods, constants, and variables are there in Java.
Everything in Java is object even the primitive data types can also be converted
into object by using the wrapper class.
Java Technology
As a development environment, Java technology provides you with large suits of tools:
A compiler (javac)
A interpreter(java)
Object and Methods:-
Java is an object-oriented programming language, abbreviated OOP. Oops is a programming
methodology that views a program as similarly consisting of objects that interacts with each
other by means of action. Object oriented programming has its own specialized terminology. The
objects are called, appropriately enough, objects. The actions that an object can take are called
methods. A java application program is a class with a method named main, and when you run the
java program the run-time system automatically invokes the method named main.
FEATURES OF JAVA:-
Platform Independent:-
Simple:-
There are various features that make the java as a simple language. Programs are easy to write
and debug because java does not use the pointers explicitly. It is much harder to write the java
programs that can crash the system but we cannot say about the other programming
languages. Java provides the bug free system due to the strong memory management. It also
has the automatic memory allocation and delectation system.
Object Oriented:-
To be an Object Oriented language, any language must follow at least the four characteristics.
Inheritance
It is the process of creating the new classes and using the behavior of the existing classes by
extending them just to reuse the existing code and adding the additional features as needed.
Encapsulation: It is the mechanism of combining the information and providing the abstraction.
Polymorphism
As the name suggest one name multiple form, Polymorphism is the way of providing the
different functionality by the functions having the same name based on the signatures of
the methods.
Dynamic binding:
Sometimes we don't have the knowledge of objects about their specific types while writing our
code. It is the way of providing the maximum functionality to a program about the specific type
at runtime. As the languages like Objective C, C++ fulfills the above four characteristics yet
they are not fully object oriented languages because they are structured as well as object
oriented
languages. But in case of java, it is a fully Object Oriented language because object is at the outer
most level of data structure in java. No standalone methods, constants, and variables are there in
java. Everything in java is object even the primitive data types can also be converted intoobject by
using the wrapper class.
Robust
Java has the strong memory allocation and automatic garbage collection mechanism. It
provides the powerful exception handling and type checking mechanism as compare to other
programming languages. Compiler checks the program whether there any error and interpreter
checks any run time error and makes the system secure from crash. All of the above features
make the java language robust.
Distributed
The widely used protocols like HTTP and FTP are developed in java. Internet programmers
can call functions on these protocols and can get access the files from any remote machine on
the internet rather than writing codes on their local system.
Portable
The feature Write-once-run-anywhere makes the java language portable provided that the
system must have interpreter for the JVM. Java also has the standard data size irrespective of
operating system or the processor. These features make the java as a portable language.
Dynamic
While executing the java program the user can get the required files dynamically from a
local drive or from a computer thousands of miles away from the user just by connecting
with the Internet.
Multithreaded:-
As we all know several features of Java like Secure, Robust, Portable, dynamic etc.; you will
be more delighted to know another feature of Java which is Multithreaded. Java is also a
multithreaded programming language. Multithreading means a single program having different
threads executing independently at the same time. Multiple threads execute instructions
according to the program code in a process or a program. Multithreading works the similar way
as multiple processes run on one computer.
Compiler/Interpreter Combo:-
Code is compiled to byte codes that are interpreted by a Java virtual machines (JVM) .This
provides portability to any machine for which a virtual machine has been written. The two
steps of compilation and interpretation allow for extensive code checking and improved
security.
No memory pointers
No preprocessor
Array index limit checking
Security
No memory pointers
by
8
Good Performance:-
Interpretation of byte codes slowed performance in early versions, but advanced virtual
machines with adaptive and just-in-time compilation and other techniques now typically provide
performance up to 50% to 100% the speed of C++ programs.
Robust Security:-
Java was designed with networking in mind and comes with many classes to develop
sophisticated Internet communications. Features such as eliminating memory pointers and by
checking array limits greatly help to remove program bug
RUNTIME ENVIRONMENT SPECIFICATIONS
Hardware Requirements:-
The physical equipment of a system is called the hardware and the following equipment
required for my project so that my project run efficiently
This equipment is as follows
1. P-Dual/Core 1.6GHz
2. Intel 845 GVSR Motherboard
3. 160GB HDD
4. Monitor
5. Keyboard
6. Mouse
7. Printer
8. CD/DVD Drive
Software requirements:-
1. JDK 1.7
Eclipse 8.0
Net Beans 7.2.1
2. Database
mysql-connector-java-5.1.22-bin.jar
4. Operating System
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
}
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
int playerChoice;
int compChoice;
String winner;
Random randomSeed = new Random();
if (source == rockButton) {
playerChoice = 0;
}
else if (source == paperButton){
playerChoice = 1;
} else {
playerChoice = 2;
}
compChoice = randomSeed.nextInt(3);
winner = findWinner(playerChoice, compChoice);
textField.setText("Winner is " + winner + "!");
if (compChoice == 0) {
textField2.setText("Computer choice is rock");
} else if (compChoice == 1) {
textField2.setText("Computer choice is paper");
} else {
textField2.setText("Computer choice is scissors");
}
}
private String findWinner(int playerChoice, int compChoice) {
String winner;
if (playerChoice == compChoice) {
winner = "Noone, it's a tie";
} else if (playerChoice == 0 && compChoice == 1) {
winner = "Computer";
} else if (playerChoice == 1 && compChoice == 2) {
winner = "Computer";
} else if (playerChoice == 2 && compChoice == 0) {
winner = "Computer";
} else {
winner = "Player";
} return winner;
}
}
Output:-
Conclusion:-
We have learned what a rock, paper and scissors game is and the rules to play this
game. We also learnt how to create a simple rock paper scissor game in Java.
While this game in Java may seem advance, it’s a great point for learning
programming concepts like class, methods, and packages.
As we become more comfortable with Java, we can add more features to the game,
such as keeping score, allowing inputs from the users that are case sensitive and
allowing the user to play multiple rounds.
With a little creativity, we can create a fun and engaging game that people will enjoy
playing
Reference:-
https://www.google.com/search?
q=conclusion+for+hotel+management+system+in+jav
a+project&oq=conclusion+for+hotel+management+system+in+java&aqs=ch
rome.1.69
i57j33i160l4j33i22i29i30l5.22941j0j15&sourceid=chrome&ie=UTF-8
https://www.javatpoint.com/online-exam-project-in-java-swing-without-database