C++

Date post:19-Aug-2014
Category:
View:218 times
Download:0 times
Share this document with a friend
Transcript:

Programming Concepts in C++

[Group Assignment]

Acknowledgement

We take this opportunity to express our gratitude to all the people who helped us to accomplish this project. We owe our deepest gratitude and sincere thanks go to our respected professor Ms Nazura and our head of the IT department Ms. Vishnupriya Raghavan. This project would not have been completed without their valuable support and guidance and motivation throughout the course.

In this opportunity we would also like t o thank our institute, Bangalore Management Academy (BMA), for providing us with all the required laboratory and library facilities for all our references and for creating a very friendly atmosphere which as a whole helped us to achieve our goal.

Asia Pacific University College of Technology and Innovation Level 2

1

Programming Concepts in C++

[Group Assignment]

Table of contents

Acknowledgment_______________________________________________ 01 Introduction_______________________________________ ____________03 Application C++__________________ ______________________________04 Staff Personnel System_________________________________________ _06 Implementation_______________________________________________ _08 OOPs concepts_________________________________________________ 08 Inheritance___________________________________________________ _09 Encapsulation_________________________________________________ _10 Class diagram_________________________________________________ _10 Test Strategies________________________________________________ _13 Validations____________________ __________________________ ______15 Screens_______________________________________________________16 Conclusion______________________ ______________________________21 Bibliography__________________________________________________ _22

Asia Pacific University College of Technology and Innovation Level 2

2

Programming Concepts in C++

[Group Assignment]

Introduction

C++ Language was developed by Bjarne Stroustrup at AT&T Bell Laboratories in early 1980s. But C++ language is still used by software developers or programmers for developing software applications, device drivers for electronic hardware. The reasons behind this are the powerful features of C++ like the Object Oriented Features allows developers or programmers to build bigger programs with extensibility, simplicity and ease of maintenance. C++ is a superset of C Language where important features that add to C Language are classes, inheritance, function overloading and operator overloading. These features help in creation of abstract data types, inherit properties from existing data types and also by supporting polymorphism makes C++ fully Object Oriented Language.

Asia Pacific University College of Technology and Innovation Level 2

3

Programming Concepts in C++

[Group Assignment]

Applications of C++

C++ is a versatile language for handling very large programs. It is suitable for virtually any programming task including development of editors, compilers, databases, communication system and any complex real-life application systems.y

Since C++ allows us to create hierarchy-related objects, we can build special objectoriented libraries which can be used later by many programmers.

y

While C++ is able to map the real world problem properly, the C part of C++ gives the language the ability to get close to the machine-level details.

y

C++ programs are easily maintainable and expandable. When a new features needs to be implemented, it is very easy to add to the existing structure of an object.

y

It is expected that C++ will replace C as general purpose language in near future.

Asia Pacific University College of Technology and Innovation Level 2

4

Programming Concepts in C++

[Group Assignment]

Benefits of OOPs Object Oriented Programming offers several benefits to both the programmer and the user. Object Orientation helps in the development and quality of software products. The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost. The principle advantages are:y y y y y y y

Inheritance helps to eliminate redundant code and extend the use of existing classes. Less development time and higher productivity. Data hiding principle helps the programmer to build secure programs. It is possible to have multiple instances of an object to co-exist without any inference. New Data and functions can be easily added whenever necessary. It is easy to partition the work in a project based on objects. Software complexity can be easily managed.

Asia Pacific University College of Technology and Innovation Level 2

5

Programming Concepts in C++

[Group Assignment]

Staff Personnel System We have developed a Win32 console application to store, search, edit and view personnel information of the staff in the company based on different access priority as mentioned in the project. This application will be used by the Administrator, Human Resource personnel, and the staff. The main purpose of this application is to store and edit the complete personal record of each staff in the company. In addition as evidence of our project we have included, a document to reflect the design of the implementation codes and the implementation details that utilises the OOP concepts.

Objective The main objective is to develop the practical ability to describe, to justify and implement an object oriented system. The main purpose of this application is to store and edit the complete personal record of each staff in the company.

Description and Justification

The Staff personnel management system is used to manage staff in an organisation where different staff has different user levels to use the system. The scope of this system is that

we have three major levels of staff that is the normal staff, human resource and Administrator. Each staff has a different permission level and actions they can perform. The Staff can perform the following activities, where the priority of access is lowy y y

View personal details Login / logout Exit System

The Human resource Staff can perform the ones listed belowy y y y

Exit System Login / logout Add Staff View staff6

Asia Pacific University College of Technology and Innovation Level 2

Programming Concepts in C++

[Group Assignment]

y y

Edit Staff Search Staff

The Administrator have the highest level of authority in the system, amongst the activities the administrative can perform are listed below:y y y y y y

Exit System Login /logout Add Staff and Human Resource Staff View Staff and Human Resource Staff Edit Staff and Human Resource Staff Search Staff and Human Resource Staff

Asia Pacific University College of Technology and Innovation Level 2

7

Programming Concepts in C++

[Group Assignment]

IMPLEMENTATION Object Oriented Programming Concepts used: A Class binds the data and its associated functions together. It allows the data and function to be hidden, if necessary, from external use. Class has two parts: 1.) Class declaration describes the type and scope of its members. 2.) Class function describes how the class functions are implemented. class Menus { private : char choice; char name[30]; char icNum[3]; char sName[30]; char gender[10]; char maritalstatus[20]; char nationality[20]; char department[20]; char designation[20]; char joinDate[10]; char sPassword[10]; char key; public : void mainmenu();///////////////////////Main Menu void managesdata();////////////////////Manage Module void searchModule();///////////////////Search Module void linModule();//////////////////////Log In Module void loutModule();/////////////////////Log out Module

Asia Pacific University College of Technology and Innovation Level 2

8

Programming Concepts in C++

[Group Assignment]

void exitModule();/////////////////////Exit Module void addStaff();///////////////////////Add Staff Module void updateStaff();////////////////////Update Module void getStaff(); void putStaff();

};

Inheritance Inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. The principle behind this sort of division is that each derived class shares common characteristics with the class from which it is derived. Here in OOP, the concept provides the idea of reusability of code, so the programmer or the user doesnt have to write the same code repeatedly. Inheritance involves subclasses and super classes. Subclasses are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. Each subclass can alter its inherited traits. class HumanResource : public Menus { public : void hrmain(); }; class OStaff : public Menus { public: void stfmain(); };

Asia Pacific University College of Technology and Innovation Level 2

9

Programming Concepts in C++

[Group Assignment]

Encapsulation The wrapping up of data and functions into a single unit is known as encapsulation. Data encapsulation is the most striking feature of the class. The data is not accessible to the outside world, only the functions wrapped in the class can access it. These provide the interface between the objects data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding. void Menus::getStaff() { system("cls"); char gSchoice,gDchoice; Menus gStaff; cout

Popular Tags: