Friday, December 29, 2017

Code Review: Payroll Management System

Compiler or Tool: Turbo C

Programming Language: C++

User Interface Type: CUI [Character User Interface]

Description:

This Payroll Management System allows staff to maintain their employees- database with details such as their name, designation, age, address etc. Even though the system is medium size it teaches how to code simple file handling support system with intuitive menu in C++ language.

The System contains 3 classes, employee class with following properties and methods:

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_image003

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

clip_image005

The system uses basic commands to arrange data on screen and 2 classes and 1function are used to manage the system. To study the code includes how files are read and write with very fancy menu.

Total code lines for this system are 1526 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, December 28, 2017

C++ Code Review: shows how virtual base class solves duplicate properties problem.

Description: This program shows how virtual base class solves duplicate properties problem.

Code:

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

//Program shows how virtual base class solves duplicate properties problem.

 

#include<iostream>

 

using namespace std;

 

class student

{

protected:

    int roll_no;

public:

    void get_no(int x)

    {

        roll_no=x;

    }

 

    void put_no()

    {

        cout<<"\nRoll Number:"<<roll_no;

    }

};

 

class test: virtual public student

{

protected:

    float sub_marks;

 

public:

    void get_submarks(float y)

    {

        sub_marks=y;

    }

 

    void put_submarks()

    {

        cout<<"\nSubject Marks:"<<sub_marks;

    }

};

 

class sports: public virtual student

{

protected:

    float sp_marks;

public:

    void get_spmarks(float z)

    {

        sp_marks=z;

    }

 

    void put_spmarks()

    {

        cout<<"\nSports Marks:"<<sp_marks;

    }

};

 

class result: public test, public sports

{

    float total_marks;

public:

    void put_result()

    {

        total_marks=sub_marks+sp_marks;

        put_no();

        put_submarks();

        put_spmarks();

        cout<<"\nTotal Marks: "<<total_marks;

    }

};

 

int main()

{

    result R;

    R.get_no(20);

    R.get_submarks(75.6);

    R.get_spmarks(81.2);

    R.put_result();

    return 0;

}                

 

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, December 26, 2017

C++ Code Review: Swaps two numbers using pointer.

Description: This program swaps two numbers using pointer.

Code:

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

//Program swaps two numbers using pointer

 

#include<iostream>

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

 

using namespace std;

 

main()

{

    int* a = new int;

    int* b = new int;

 

    cout << "Enter value of a and b:";

    cin >> *a >> *b;

 

//put a in temp

    int* temp = a;

//put b in a

    a = b;

//put temp, was a, into b

    b = temp;

 

    cout << "After swapping \n a=" << *a << "\n b=" << *b;

 

    delete a;

    delete b;

    return 0;

}               

 

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.