Friday, October 20, 2017

Code Review: Casino Game System

Compiler or Tool: Turbo C

Programming Language: C++

User Interface Type: CUI [Character User Interface]

Description:

This Casino Game System is nothing but automating casino game process. Even though the system is very small it teaches how to code simple system of RAM type [i.e., not file handling support system] in C++ language.

The include dependency graph of system is like this:

clip_image001

The main() function presents main menu and becomes single point entry and exit code. The main() function call graph is as follows:

clip_image002

The menu presented by this main() function is as follows:

clip_image004

The system is good example for how to generate a good idea/code with already existing game. It uses randomize function to throw dice or user guess number. It is open for adding more features and facilities within it.

Total code lines for this system are 92 lines [approximately]. It is a most suitably called as mini project in C++ language.

If you want to write or construct or program C++ mini-project and do not know how or from where to start buy this simple e-book: Code Review of 26 C++ mini-projects.

Note: For other details send request e-mail to mailforprojects@rediffmail.com. Add your comments in below available comment box.

 

Note: Click these label/tags to view all related posts. Tags: C++MiniProject

 

…till next post, bye-bye & take care.

Thursday, October 19, 2017

C++ Code Review: calculates sum of series of type 1/2+4/5+7/8+....

Description: This program calculates sum of series of type 1/2+4/5+7/8+....

Code:

//Compiling Tool: Code::Block IDE with MinGW

//Program calculates sum of series of type 1/2+4/5+7/8+...

 

#include<iostream>

#include<conio.h> //for getch()

 

using namespace std;

 

int main()

{

 

    int i,n;

    float sum=0,x,a=1;

 

    cout<<"Series Type:(1/2)+(4/5)+(7/8)+..."<<endl;

    cout<<"Enter the range of n:";

    cin>>n;

 

    for(i=0; i<n; ++i)

    {

        x=a/(a+1);

        sum+=x;

        a+=3;

    }

 

    cout<<"Sum="<<sum;

    getch();

}

 

Output:

clip_image002

If you want to write or construct or program C++ mini-project and do not know how or from where to start buy this simple e-book: Code Review of 26 C++ mini-projects. For book sample click this link.

Add your comments in below available comment box.

Note: Click these label/tags to view all related posts. Tags: C++Code

 

…till next post, bye-bye & take care.

Tuesday, October 17, 2017

C++ Code Review: calculates sum of series of type 1+1+2+1+2+3+1+2+3+4+ …(1+2+3+…+n).

Description: This program calculates sum of series of type 1+1+2+1+2+3+1+2+3+4+ …(1+2+3+…+n).

Code:

//Compiling Tool: Code::Block IDE with MinGW

//Program calculates sum of series of type 1+1+2+1+2+3+1+2+3+4+…………..1+2+3+………+n.

 

#include<iostream>

#include<conio.h> //for getch()

 

using namespace std;

 

int main()

{

 

    int i,j,n,sum=0;

    cout<<"Series Type:1+1+2+1+2+3+1+2+3+4+...(1+2+3+………+n)"<<endl;

    cin>> n;

 

    for(i=1; i<=n; i++)

    {

        for(j=1; j<=i; j++)

        {

            sum+=j;

            if(j==n)

            {

                cout<<j;

            }

            else

            {

                cout<<j<<" + ";

            }

        }

    }

 

    cout<<"Total of series: "<< sum;

    getch();

}

 

Output:

 clip_image002

If you want to write or construct or program C++ mini-project and do not know how or from where to start buy this simple e-book: Code Review of 26 C++ mini-projects. For book sample click this link.

Add your comments in below available comment box.

Note: Click these label/tags to view all related posts. Tags: C++Code

 

…till next post, bye-bye & take care.