/PeriodiX

A simple quiz game for the High School Students to help them learn the periodic table.

Primary LanguageC++

Version Tag

PeriodiX

This is my Class 12 Computer Science Project. This Code has been preparedon Turbo C++ . It uses Graphics.h for the Graphical User Interface.

Files in the Repository

The files in the repository are :

Project.cpp

This is File that contains the Source Code for the Project.

README.md

The Description file containing details about the repository. The file that you looking at right now.

Computer Project.pdf

The Project Report. Contains the Same Data as this README.

.Output

This folder contains the Output images for the README.

.Backup

This Folder contains the Backup/Test Files that were usedin the preparation of the Project.

Header Files Used

HEADER FILE FUNCTIONS USEd
Fstream.h Cout , Cin , Open ( ) , Close ( ) , Read( ) , Write ( ) , Seekg ( )
Conio.h Kbhit ( ) , Getch ( ) , Clrscr ( )
String.h Strcpy ( ) , Strcmpi ( ) , Strlen ( ) , Strcat ( )
Stdlib.h Ltoa ( ) , Itoa ( ) , Exit ( ) , Randomize ( ) , Random ( )
Stdio.h Remove ( ) , Rename ( )
Dos.h Delay ( ) , Sleep ( )
Math.h Sqrt ( )
Ctype.h Isalpha ( ) , Isspace ( ) , Isdigit ( ) , Ispunct ( )
Iomanip.h Setw ( )
Graphics.h Initgraph ( ) , Cleardevice ( ) , Gettextsettings ( ) , Settextstyle ( ) , Outtextxy ( ) , Textwidth ( ) , Textheight ( ) , Setcolor ( ) , Setfillstyle ( ) , Getbkcolor ( ) , Line ( ) , Fillpoly ( ) , Drawpoly ( ) , Rectangle ( ) , Bar ( ) , Circle ( ) , Ellipse ( ) , Fillellipse ( ) , Getpixel ( ) , Putpixel ( ) , Closegraph ( )

Structures Used

Struct quest : Question/Answer for each Element.

  • Questions for the Element.
  • Options as an array of 4 Options for each of the Questions.
  • Answers for each of the Questions.

Struct coord: Coordinates for each Element in the Table.

  • X - Coordinate.
  • Y - Coordinate.
  • Color of the Element.

Struct data : Chemical Data for each Element.

  • Name.
  • Symbol.
  • Group.
  • Period.
  • Atomic Mass.
  • Atomic Number.
  • Electronic Configuration.
  • Block.
  • Element Type.

Classes Used

Class element : Data Type for each Element.

  • Data
  • Coord
  • Array of Quest
FUNCTION NAME FUNCTIONALITY
voidputblktypepd( ) ; Usedto Calculate the Block , periodandType of Element Depending Upon its Position in the Periodic Table.
voidputd( data ) ; Usedto put Structure Data details in an Object of Class Element.
voidputcoord( coord) ; Usedto put Structure Coorddetails in an Object of Class Element.
voidputq ( quest [ ] ) ; Usedto put Structure Question details in an Object of Class Element.
voidgetdata ( data& , quest [ ] , coord& ) ; Usedto Get the details of an Element in the form of Data , Questions andCoordinates.
int matchxy ( float , float ) ; Usedto match the ( x , y ) Coordinates of an Element in the Periodic Table.
element ( ) ; Constructor to Initialize all data Members with NULL Values.

Class login : Data Type for each User.

  • Name
  • Password
  • Access Type
  • Highest Score
  • Latest/Current Score
  • Total Points
FUNCTION NAME FUNCTIONALITY
voidaccept ( char [ ] , char [ ] ) ; Accept Login IdDetails.
voidgetinfo ( char [ ] , char [ ] , long [ ] ) ; Usedto Return the Login Id Details of a User.
voids_upd( long ) ; Usedto Update the Score of a User.
voidmadmin ( ) ; Usedto Give a User Administrative Access.
int mname ( char [ ] ) ; Usedto Match a Name with that of the User.
int mpass ( char [ ] ) ; Usedto Match a Passwordwith that of the User.
int mac ( ) ; Checks whether a user has Administrative Rights
login ( ) ; Constructor to Initialize all data Members with NULL Values.

Global Functions

FUNCTION NAME FUNCTIONALITY
voidsup ( float x , float y , char str [ ] ) ; Displays a String as a Superscript at ( x , y ) .
voidconfig ( float x , float y , char str [ ] ) ; Displays the Configuration of an Element.
voidginput ( float x , float y , char str [ ] , char type ) ; Usedto Take the User Input in Graphics Mode Depending Upon the Call as Passwordor Regular Text.
voidplaym ( ) ; Creates the Menu for Play Option.
voidchangepass ( ) ; Creates the Menu for changing the User Password.
voidstatpage ( ) ; Displays the User Statistics.
voidclrstats ( ) ; Clears the User Statistics.
voiddelcu ( ) ; Deletes the Current User Account.
voidsetpage ( ) ; Creates the Menu for the User Settings Page.
voidmpage ( ) ; Creates the Main Game Menu.
voidviewelement ( ) ; Displays the Details of an Element.
voidgdspage ( ) ; Creates the Menu for Game Data Settings.
voidlou ( ) ; Displays the List of User Accounts.
voidmod( ) ; Usedto give Administrative Rights to a Non – Admin.
voiddeluser ( ) ; Usedto Delete a User from the list-of-users.
voidudspage ( ) ; Creates the Menu for User Data Settings.
voidapage ( ) ; Creates a Menu for an Administrator to Change the Game Settings.
voidlpage ( ) ; Creates the Login Page.
voidspage ( ) ; Creates the Sign Up Page.
voidwpage ( ) ; Creates the Welcome Page.
voide_screenf ( float x , float y ) ; Displays the Information about an element at the location ( x , y ) in the Periodic Table.
voidcoordwrite ( float x , float y , int col ) Usedto Write the Coordinates of an Element into the File.
voidscreen ( int para ) ; Usedto Display the Periodic Table.
voidcnt ( float x , float y ) ; Usedto Display the Controls for the Periodic Table.
voidnav ( float &x , float &y , int &col , int para ) ; Usedto Navigate through the Periodic Table.
voidrect ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 , int x4 , int y4 ) ; Usedto make a Quadrilateral.
voidmainf ( int para ) ; Usedfor the Periodic table Option in the Main Menu.
voiddisplay ( element e ) ; Usedto Display the Element During the Game.
voidrandomarr ( int rec [ ] , int n ) ; Usedto Give Random values to an Array starting from Zero.
voidblk ( char temp [ ] [30] ) ; Usedto Generate random Blocks as Options for the Questions.
voiddefwrite ( ) ; Usedto Set Default values to The Element Data in case of any Errors.
voidquestrandom ( quest qq[5] ) ; Randomizes Question andOptions Order Every time the Game is Played.
voidscorepage ( int score[5] , int lvl ) ; Displays the Score andthe Result of a Level.
voiduserupdate ( long ) ; Updates the Score of the Player after every Level.
int epage ( ) ; Exit Page.
int play ( int ur , int lvl ) ; Usedto Play the Game.
int toggle ( char head[ ] , char menu [ ] [50] , int r ) ; Usedto Create Menu ( s ) AndSelect the Options.
char* opttoogle ( quest qq [ ] , int i ) ; Toggle through the Question Options.
voidslantellipse ( float m , int s1 , int s2 ) ; Usedto make SlantedEllipse.

Output Screens

IMG-1

IMG-2

IMG-4

IMG-5

IMG-6

IMG-7

IMG-8

IMG-9

IMG-10

IMG-11

IMG-12

IMG-13

IMG-14

IMG-15

IMG-16

IMG-17

IMG-18

IMG-19

IMG-20

IMG-21

IMG-22

IMG-23

IMG-24

IMG-25

IMG-26

IMG-27

IMG-28

IMG-29

IMG-30

IMG-31

IMG-32

IMG-33

IMG-34

IMG-35

IMG-36

IMG-37

IMG-38

IMG-39

IMG-40

IMG-41

IMG-42

IMG-43

IMG-44

IMG-45

IMG-46

IMG-47

IMG-48

IMG-49

IMG-50

IMG-51

IMG-52

IMG-53

IMG-54

IMG-55

IMG-56

IMG-57

IMG-58

IMG-59

IMG-60

IMG-61

IMG-62

IMG-63

IMG-64

IMG-65

IMG-66

IMG-67

IMG-68

IMG-69

IMG-70

IMG-71

IMG-72

IMG-73

IMG-74

IMG-75

IMG-76

IMG-77

IMG-78

Bibliography

Developers Tag