Documente Academic
Documente Profesional
Documente Cultură
INTRODUCTION
Chapter: 1 INTRODUCTION
The project is based on Puzzle Game. This is a Core Java (front end) and MySQL (back end) based application. The game will provide joy to the player playing it and its a great time pass as well.
1. Puzzle Word: Game provides a jumbled word, which the player has to guess.
3. Playing the Game: User can easily guess the word by trying various combinations. .
4. Quality of Output: User can increase his/her IQ level and off course can get vivified.
There are no second chances in this game. The game will provide a word whose letters will be arranged randomly, the player has to think of all the combinations and have to guess the right one. If the player guessed the right word, it will be correct and next word will appear (means the next riddle) and if he/she guesses a wrong combination of the letters then it will be incorrect and again a new word will be shown on the screen. In this way, the game doesnt provides a second chance
PREFACE
Computers are revolutionizing every aspect of our life. The offices where we work, the stores where we shop, the schools and the colleges we attend, the banks that handle our money, the devices we use in our home and in every area of our life are being radically altered by computers.
Even new inventions & discovery is somehow related to computers. Computers have changed mans life. Besides home shopping or maintaining records even today computer chips are being implanted in humans body that identifies you uniquely.
Computers usage is growing by leaps and bounds in business, industry, government, colleges, schools and other institutes .In the modern era of science and technology as a powerful nation, India is still lagging behind due to dis-advancement in computer technologies. This problem can be overcome only when the youth of India of the present generation give full co-operation in rising India as a powerful nation by learning more and more computer.
In ever widening modern world, the present system of education is facing new challenges. It is well known fact that today is the age of computers. The major achievement of science and technology .Now-a-days everyone is realizing the importance of computer which of modern age in fifth generation of computers.
This course is aimed at making students a complete and self-reliant programmer. We are given all the needed Knowledge about the structure and the basis of computers at first stage & then study of various business requirements is involved in the last semester as project work. Thus candidate is exposed to real time environment. The students are also given proper knowledge of various computer languages so as to do programming to change any manual atmosphere to a computerized system.
10
They have to work in any organization and have to change a manually working system in a computerized system so that they are able to understand the problems arising out of such an environment.
11
CHAPTER - 2
REQUIREMENT SPECIFICATIONS
12
Requirement analysis relies on fact-finding techniques. These include: Interview Questionnaires Record inspection On-site observation
13
CHAPTER - 3
PROPOSED SYSTEM
14
Chapter: 3
PROPOSED SYSTEM
The Game (Guess the Word) is an easy to maintain, ready to run, scalable, affordable and reliable cost saving tool from Software Associates suited for small, medium, and large projects. Features and Benefits:
The proposed system can be used even by the nave users and it does not require any educational level, experience, and technical expertise in computer field but it will be of good use if the user has the good knowledge of how to operate a computer.
15
ADVANTAGES OF PROPOSED SYSTEM User-friendly package because it is very much according to the users requirements. It would take less time to get familiar with package.
Graphical user interface (GUI) is provided to the user. For security purpose authentication is provided, so that unauthorized user cant use manipulate the site.
Suitable help/error message for better user interface i.e. if user makes some mistake, the error message will be generated.
For security purpose, if the user wants to change the password, he/she can do this very easily.
The web-site is an easy to use application that can be helpful for day-to-day needs.
The users can give their valuable suggestions & feedbacks betterment of the site.
16
CHAPTER - 4
FEASIBILITY STUDY
17
TECHNICAL FEASIBILITY:
OPERATIONAL FEASIBILITY: Define the urgency of the problem and the acceptability of any solution; if the system is developed, will it be used? Includes people-oriented and social issues: internal issues, such as manpower problems, labor objections, manager resistance, organizational conflicts and policies; also external issues, including social acceptability, legal aspects and government regulations.
FINANCIAL FEASIBILITY:
crue from the new system worth the costs? ll result from the system, Including tangible and intangible ones? e the development and operational costs?
18
CHAPTER - 5
19
1. Operating System: Windows XP/vista/7 or later version, Linux OS which supports networking. 2. JAVA development tool kit
HARDWARE Hardware requirements for Insurance on internet will be same for both the parties which are follows:
Processor: - Pentium I or above. RAM: HD: NIC: 128 MB or above. 20 GB or above. For each party
20
CHAPTER - 6
SYSTEM DESIGN
21
DFD (DATA FLOW DIAGRAM) Data flow diagram is graphical tool used to describe and analyze the movement of data through system manual or automated- including the process, stores of data and delays in the system. Data flow diagrams are the central tool and the basis from which other components are developed. The transformation of data from input to output through process may be described logically and independently of the physical components associated with the system. They are termed logical data flow diagrams. COMPONENTS OF DFDS
DATA FLOW: Data move in a specific direction from an origin to a destination in a form of a document letter, telephone call or virtually any medium.
PROCESS: People, procedures or devices that are used to produce data. The physical component is not identified.
SOURCE OR DESTINATION OF DATA: External sources or destinations of data which may be people, programs, organizations or other entities, interact with the system but are outside its boundary. The term source and sink are interchangeable with origin and destination.
DATA STORE: Here data are stored or referenced by a process in the system. The data store may represent computerized or non-computerized devices.
22
DFD:
PLAYER PUZZLE
INCORRECT CORRECT
NEW WORD
23
CHAPTER -7
24
PURPOSE OF ERD The primary purpose of the ERD is to represent data objects and their relationship. The (min,max) notation
25
WORD
INCORRECT
GUESS CORRECT
PLAYER
E-R Diagram
26
CHAPTER 8
CODING
27
Chapter: 8 CODING
Game.java: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ packageguesstheword; importjava.sql.ResultSet; importjava.util.ArrayList; importjavax.swing.JOptionPane; importsun.audio.*; import java.io.*; importjava.util.logging.Level; importjava.util.logging.Logger;
/** * Creates new form Game */ public Game() { initComponents(); setPuzzleword(); try { 28
} }
voidsetPuzzleword() { intrandosr = (int) (Math.random() * 9); String query = "select scrambled from game where sr=?"; ArrayList al = new ArrayList(); al.add(randosr); try { ResultSetrs = SqlUtil.getData(query, al); if (rs.next()) { jTextField2.setText(rs.getString("scrambled")); }
} catch (Exception e) { } }
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked")
29
//
<editor-fold
defaultstate="collapsed"
desc="Generated
Code">//GEN-
jButton7 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jTextField2 = new javax.swing.JTextField(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton();
jButton7.setText("Next>");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextField2.setBackground(new java.awt.Color(204, 204, 204)); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEventevt) { jTextField2ActionPerformed(evt); } });
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() 32
.addGap(130, 130, 130) .addComponent(jButton1) .addGap(175, 175, 175) .addComponent(jButton2) .addGap(0, 55, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4))) .addGap(31, 31, 31) .addComponent(jButton5)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(40, 40, 40)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField1) .addComponent(jTextField2, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton3) .addGap(107, 107, 107)) javax.swing.GroupLayout.DEFAULT_SIZE, 160,
33
javax.swing.GroupLayout.PREFERRED_SIZE,
0,
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton1)
34
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
290,
private
void
jButton1ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
try {
String query = "select * from game where scrambled=? and correct=?"; ArrayList al = new ArrayList(); al.add(scram); al.add(ori); ResultSetrs = SqlUtil.getData(query, al); if (rs.next()) {
private
void
jButton2ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
private
void
jButton3ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
}//GEN-LAST:event_jButton3ActionPerformed
private
void
jTextField1ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
private
void
jTextField2ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
36
private
void
jButton4ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
FIRST:event_jButton4ActionPerformed // TODO add your handling code here: DebugAdmin da=new DebugAdmin(); da.setVisible(true); this.dispose(); }//GEN-LAST:event_jButton4ActionPerformed
private
void
jButton5ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
private
void
jButton6ActionPerformed(java.awt.event.ActionEventevt)
{//GEN-
/** * @paramargs the command line arguments */ public static void main(String args[]) { /* * Set the Nimbus look and feel 37
*/ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and feel. For details see * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Game.class.getName()).log(java.util.logging.Level.SEVERE , null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Game.class.getName()).log(java.util.logging.Level.SEVERE , null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Game.class.getName()).log(java.util.logging.Level.SEVERE , null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Game.class.getName()).log(java.util.logging.Level.SEVERE , null, ex); } //</editor-fold>
/* 38
public void run() { new Game().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables privatejavax.swing.JButton jButton1; privatejavax.swing.JButton jButton2; privatejavax.swing.JButton jButton3; privatejavax.swing.JButton jButton4; privatejavax.swing.JButton jButton5; privatejavax.swing.JButton jButton6; privatejavax.swing.JButton jButton7; privatejavax.swing.JLabel jLabel1; privatejavax.swing.JLabel jLabel2; privatejavax.swing.JLabel jLabel3; privatejavax.swing.JTextField jTextField1; privatejavax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables
} Tester.java : /* * To change this template, choose Tools | Templates * and open the template in the editor. */ packageguesstheword; 39
class tester { staticint counter=0; void music()throws IOException { try { InputStream in=new FileInputStream("E:/s.wav"); AudioStream as=new AudioStream(in); AudioPlayer.player.start(as); } catch(Exception c) { System.out.println(c); } } void music1()throws IOException { try { counter++; InputStream in=new FileInputStream("E:/a.wav"); AudioStream as=new AudioStream(in); 40
AudioPlayer.player.start(as); if(counter>1) { InputStream in1=new FileInputStream("E:/c.wav"); AudioStream as1=new AudioStream(in1); AudioPlayer.player.start(as1); } } catch(Exception c) { System.out.println(c); } } } SqlUtil : packageguesstheword;
private static String driver; private static String url; private static String sqluser; private static String sqlpwd;
newSqlUtil().loadValues(); 41
try{ Class.forName(driver); }catch(Exception e) { System.out.println("Loading Driver Failed"); } Connection con = DriverManager.getConnection(url, sqluser, sqlpwd); return con; } public static intins_up_del(String query, ArrayListparam) throws Exception { Connection con = getConnect(); PreparedStatementps = con.prepareStatement(query); if (param != null &¶m.size() > 0) { for (int index = 0; index <param.size(); index++) { ps.setObject(index + 1, param.get(index)); } } introwsAffected = ps.executeUpdate(); returnrowsAffected; }
public static ResultSetgetData(String query, ArrayListparam) throws Exception { Connection con = getConnect();
PreparedStatementps = con.prepareStatement(query); if (param != null &¶m.size() > 0) { for (int index = 0; index <param.size(); index++) { ps.setObject(index + 1, param.get(index)); } } ResultSetrs = ps.executeQuery(); 42
returnrs; }
voidloadValues() throws Exception { InputStream is = this.getClass().getResourceAsStream("values.properties"); java.util.Propertiespr = new java.util.Properties(); pr.load(is); driver = pr.getProperty("driver"); url = pr.getProperty("url"); sqluser = pr.getProperty("sqluser"); sqlpwd = pr.getProperty("sqlpwd"); } } Debugger.java : /* * To change this template, choose Tools | Templates * and open the template in the editor. */ packageguesstheword;
/** 43
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() {
jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N jLabel3.setForeground(new java.awt.Color(204, 204, 204)); jLabel3.setText("Username : ");
jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N jLabel4.setForeground(new java.awt.Color(204, 204, 204)); jLabel4.setText("Password : ");
jButton1.setBackground(new java.awt.Color(51, 51, 51)); jButton1.setText("Login! --->"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEventevt) { jButton1ActionPerformed(evt); 45
} });
jButton2.setBackground(new java.awt.Color(51, 51, 51)); jButton2.setText("Go Back <---"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEventevt) { jButton2ActionPerformed(evt); } });
46
313, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(221, 221, 221)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jButton2) .addContainerGap()))))) .addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
47
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 527, 168,
javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(108, 108, 108) .addComponent(jButton1))) .addContainerGap(33, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 70,
javax.swing.GroupLayout.PREFERRED_SIZE)
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 48
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1) .addGap(28, 28, 28) .addComponent(jButton2) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(59, 59, 59) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 214,
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) );
private void jButton2ActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here: Game gm=new Game(); gm.setVisible(true); this.dispose(); }
private void jButton1ActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here: String scram=jTextField1.getText(); String ori=jTextField2.getText(); try {
String query = "select * from login where username=? and password=?"; ArrayList al = new ArrayList(); al.add(scram); al.add(ori); ResultSetrs = SqlUtil.getData(query, al); if (rs.next()) { jTextField2.setText("***********"); JOptionPane.showMessageDialog(this, "Correct!!! Welcome Administrator ^_^"); new debugger().setVisible(true); } else { jTextField2.setText("***********"); 50
JOptionPane.showMessageDialog(this, "Incorrect!! Try Again!! *_* "); } } catch (Exception ec) { ec.printStackTrace(); } }
/** * @paramargs the command line arguments */ public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and feel. For details see * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) { 51
if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(DebugAdmin.class.getName()).log(java.util.logging.Level.S EVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(DebugAdmin.class.getName()).log(java.util.logging.Level.S EVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(DebugAdmin.class.getName()).log(java.util.logging.Level.S EVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(DebugAdmin.class.getName()).log(java.util.logging.Level.S EVERE, null, ex); } //</editor-fold>
privatejavax.swing.JButton jButton1; privatejavax.swing.JButton jButton2; privatejavax.swing.JLabel jLabel1; privatejavax.swing.JLabel jLabel2; privatejavax.swing.JLabel jLabel3; privatejavax.swing.JLabel jLabel4; privatejavax.swing.JLabel jLabel5; privatejavax.swing.JPanel jPanel1; privatejavax.swing.JTextField jTextField1; privatejavax.swing.JTextField jTextField2; // End of variables declaration }
53
CHAPTER 9
OUTPUT
54
Chapter : 9 OUTPUT
Front page
55
Word guess
56
Correct guess
57
Incorrect guess
58
Debug page
59
Background image
60
CHAPTER = 10
61
2. Object Oriented: In JAVA all program code resides within objects and classes. Java comes with an extensive set of classes, arranged in packages that we can use in our programs by inheritance.
3. Robust: Java is a strictly typed language; it checks code at compile time as well as run time. Java includes the feature of exception handling.
4. Data Security : Java is depends upon oops concepts in which you must implement the class & data in class is by default private for the other package which cant be accessible in any way / manner into other classes , so out data is totally secure .
5. Multithreading: Java supports multithreaded programming which means handling multiple tasks simultaneously. We need not wait for an application to finish one task before beginning another.
62
CHAPTER 10
63
ADVANTAGES OF MYSQL
1. Handles large databases and performs space management: Oracle provides support for handling large amount of data stored in the database. It allows full control of space uses to make efficient use of expensive hardware devices.
2. High performance: Oracle maintains high degree of system performance by implementing database tasks in parallel which speed up querying, maintenance of the database.
3. Availability of data: Operations such as database backup failure do not interrupt the availability of the data to the users.
4. Security: Oracle provides security by password expiration and forced password changes, password history maintenance to prevent users from reusing previous passwords.
5. Portability: Oracle can be easily ported to work under different operating system like Windows 95, Windows NT, Windows 2000, UNIX, Linux etc.
6. Replication of data: Oracle allows keeping copies of the database objects in multiple databases that make up a distributed database system. It provides users with fast local access to shared data and protects availability of data because alternate database access options exist.
64
CHAPTER 11
FUTURE SCOPE
65
66
CHAPTER 12
CONCLUSION
67
Chapter: 12 CONCLUSION
This is to conclude that the project that I undertook was worked upon with a sincere effort. Most of the requirements have been fulfilled up to the mark and the requirements which have been remaining, can be completed within a short extension .
68
CHAPTER 13
REFERENCES
69
Chapter: 13 REFERENCES
en.wikipedia.org/wiki/Coupon www.scribd.com Research Internet & Technology kaderphy.hubpages.com All Topics Technology seminarprojects.com/s/existing-system-in-java websearch.about.com/.../gamesearch/.../advantages-online-... websearch.about.com/.../gamesearch/.../advantages-online-... anamikas.hubpages.com ... Frugal Living Bargain Shopping www.mwsearch.com/jumblewordadvice.html katrinasui.hubpages.com All Topics Business and Employment www.fotosearch.com/photos-images/online.html www.royalimages.in/Pages/Home.aspx www.saching.com/Article/Disadvantages-of-java/3488 www.fast-counter.com/disadvantages-of-gaming/ seminarprojects.com/s/future-scope-of-online-shopping www.pressreleasepoint.com/bright-future-online-shoppi... - United States
70