Git Product home page Git Product logo

truefalse's Introduction

TrueFalse Game

This project was created for Object-Oriented Java course in Laurea University of Applied Sciences.

What is TrueFalse?

  • The idea of the application is to let the user create a custom quiz with two possible answers, True and False.
  • In the database menu, the user can see the list of all statements (with their correct answers) in the database. Database management, including creation and deletion of custom statements is also a feature.
  • By clicking 'Play' in the Main Menu, the game will start asking whether the statements are True or False one by one (reading them from the database). After the user has answered to all questions, the application displays the number of correct answers and returns to the Main Menu.

How to Quick Setup and Run:

  • Launch MySQL (with XAMPP for example)
  • Run the TrueFalseGame.jar (executable) file.
  • Enjoy the App experience!

Alternative Setup:

  • You need to have Eclipse (with JDBC library) installed on your computer and have access to MySQL.
  • Download the .java files from the GitHub src-folder OR just simply download everything as .ZIP.
  • Import these files into your Eclipse (if you downloaded everything as .ZIP, Eclipse should recognize the files as one project).
  • Launch MySQL (with XAMPP for example).
  • (OPTIONAL) Use the .SQL file (in src-folder) with phpMyAdmin to import 5 default quiz questions. This is not mandatory as the application lets the user create custom quizzes and creates database/tables automatically. You will need Apache for this.
  • Run the java classes with your Eclipse.
  • Enjoy the App experience!

Commonly known bugs:

  • Editing the database during a play-session may result in a crash. However, this should require the user having two copies of the application running at the same time. This could be fixed by making the application run a new instance of the database when entering the 'play mode'.

You can find a screenshot of the GUI in the files folder.


List of Variables and Objects in each class:

MainMenu.java

  • boolean playing
  • multiple button objects
  • instance of object QuestionQueries "questionQueries"

Game.java

  • int count
  • int points
  • boolean userAnswer
  • instance of QuestionQueries
  • multiple button objects

DisplayQuestions.java

  • JTable tableQuestion
  • JButton btnAddQuestion
  • JButton btnClear
  • JButton btnBack
  • instance of object DefaultTableModel "myQuestionTableModel"
  • ArrayList allQuestions
  • instance of object Question "currentQuestion"

QuestionQueries.java

  • Prepared Statements

Question.java

  • Constructor for Question objects
  • int id
  • String statement
  • boolean answer

truefalse's People

Contributors

sammmpo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.