Sunday, February 12, 2012

Delay function in codeblocks

In code block you can use
Sleep(unsigned int miliseconds);
function for delay in execution.
delay(unsigned int miliseconds) function is used in turbo c. For codeblocks you have to add code which is given below example:
#include<stdio.h>
#include<time.h>
void delay(unsigned int mseconds)
{
    clock_t goal = mseconds + clock();
    while (goal > clock());
}
int main()
{
    int i;
    for(i=0;i<10;i++)
    {
    delay(1000);
    printf("This is delay function\n");
    }
    return 0;
}

Friday, February 3, 2012

Draw a 3D Rubik cube using OpenGL utility toolkits GLUT with source code

This article is similar  to my previous article drawing 3D chess board.To make Rubik cube real I have used texture mapping.At first I draw a one cube where I mapped texture in all six side of cube with six different color images and you can save these images from here.After that 27 cube is drawn by looping and final Rubik cube is drawn, rotating in (2,2,0) axis.For texture mapping we have to write a code to load a images and store a value of (R1,G1,B1,R2,G2,B2,……………)pixels in pixels array.In this project there is a Image class where you can see in source code below in file name imageloader.h and imageloader.cpp which I have take from a website www.videotutorialsrock.com.
All the images for this program is given below save it in your project file location.

Saturday, January 28, 2012

Mini project student database system in c++ source code download

This is simple student information system project.Wher you can do following things 1. Add    Records
          2. List   Records
          3. Modify Records
          4. Delete Records
          5. Exit   Program
to store data file is used. Download project from GitHub.

How to display a system date and time using c++

#include <ctime>
#include <iostream>
using namespace std;
 
int main() {
    time_t t = time(0);   // get time now
    struct tm * now = localtime( & t );
    cout <<  now->tm_mday << '-'//day
         << (now->tm_mon +1 )  << '-'//month
         << (now->tm_year +1900 )//year
         <<endl
         <<now->tm_hour//hour
         <<'-'<<now->tm_min//min
         <<'-'<< now->tm_sec//sec
         << endl;
 
         return 0;
}

Wednesday, January 25, 2012

Mini project Hang Man in C++ source code download

It is a simple project just to provide a Hang Man game concept.In this project I haven’t draw a man for a wrong choice so,try to draw a simple man by using “|” pattern in your project which make your project better .
Here is the source code ,copy and compile it in Code::blocks gcc compiler or Download project from GitHub.

Mini project school fee enquiry management system in c++ source code download

This mini project is written by my friend in C++ which is simple console application without graphics.This is a fee structure program It can be used for following ways:-
1.We can  view the fee slip of a student of a class
2.We can also Modify the fee structure of the school
3.And View the fee structure of the school in the form of alist
The menu functions are described as follows
1. FEE SLIP:  This function displays the fee slip for a givenstudent
from the class entered by the user.
2. MODIFY:    This function modifies the fee structure for a give class.
The user can change the fees for various fields
3. LIST:      This function displays the list of total fees for all the
Here is the source code ,copy and compile it in gcc compiler with code::blocks IDE or Download project from GitHub.

Mini project supermarket billing system in c++ source code download

This mini project is written in C++ where you find mainly two classes one class item another class amount and class amount is inheritance form class item.It is simple console application without graphics. From this project you learn file handling in c++ and use of stream class.And main defect of this program is that goto label  is used to jump form one menu to another menu and separate function for editing  and deleting items are not used.So,if you want to make it your school project or college mini project then modify it ,make separate function for editing and deleting and also try to use while loop instead of goto label .Any suggestion and help for this project is appreciated .
Here is the source code ,copy and compile it in gcc with code::blocks IDE or Download project from GitHub.