Anda di halaman 1dari 84

INTRODUCTION TO PROJECT

This documentation is meant to capture the requirements of the project as given


by the client and understood by the project representative. This also acts as a
reference for other phases in the lifecycle like design; coding, testing etc. It also
helps as a future reference for any enhancements/ modifications to the
requirement specification/ system.

This is also meant to be a guidance document for:

1. USER: For understanding the functionality that would be implemented by


the system.

2. SYSTEM DESIGNER: Source for requirement specification needed for the


design of the system.

3. TESTER: To understand the testing requirement specification and derived


the test cases and to arrive a feasible approach for testing the system.
PROBLEM SECTION

The objective of this phase is to obtain a system definition which will than be
implemented if accepted in the subsequent analysis and design phases.

The basic activities are:

1. Determine the objectives of current system.

2. Study current system to see how far it meets its objective.

3. Analyze users and companies requirements to develop new objectives.

4. Identify constraints imposed by user’s environment.

5. Identify user’s responsibility of data inputs and outputs to other systems.

6. Examine interaction of proposed system with other systems.

7. Prepare details of requirements user data elements, volumes, response time


etc.

8. Prepare design specification.

9. Prepare plan for design and implementation phases.

10. Produce a report for the user and system management.


PROJECT MONITORING

Project monitoring system means monitor or evaluate the system regularly. It


includes the following functions:

1. Estimating resource requirements.

2. Scheduling tasks and events.

3. Providing for training and site preparation.

4. Selecting qualified staff and supervising their work.

5. Monitoring the project’s program.

6. Documenting.

7. Periodic evaluating.

8. Contingency planning.
SYSTEM STUDY

The term system refers to the concept by which we can able to understand the

system according to the basic concepts of system.

It is derived from the Greek word System which means an organized relationship

between functioning units or components.

It is designed to achieve more than one objective. The study of system has three

basic implications:

1. A system must be designed to achieve a predetermined objective.

2. Interrelationships and the interdependence must exit

among the components.

3. The objectives of the organization as a whole have a

higher priority that the objectives of its subsystems.


SYSTEM ANALYSIS

At the heart of system analysis is a detailed understanding of all important faces

of the business areas under investigation. The key questions are:

1. What is being done?

2. How is it being done?

3. How frequently does it occur?

4. How great is the volume of transactions or decisions?

5. How well is the task being performed?

6. Does a problem exist?

7. If a problem exists? How serious is it? What is the underline cause?

To answer the above questions system analyst discuss with different

category of persons to collect the facts about the business process and their

opinion of why things happen as they do and their views for changing the existing

process. During analysis data are collected on the available files, decision points

and transactions handled by the present system.


SYSTEM DESIGN

System design is a solution, a “how to” approach the creation

of a new system. This important phase is composed of several steps. It provides

the understanding and procedural details necessary for implementing the

recommended in the feasibility study. Emphasis is on translating the performance

requirements into design specification. Design goes through logical and physical

stages of development.

Logical design reviews the present physical system, prepares

input and output specifications, makes edit, security and Control specification,

details the implementation, and prepares a logical design walkthrough. The

physical design maps out the details of the physical system, plans the systematic

implementation, devises a test and implementation plan, and specifies any new

hardware and software.


SYSTEM TESTING

The objective of testing is to verify that the program function as it should, that it

confirms with its specification and solves the right problem in the real world.

The aim of debugging on the other hand is to remove program errors and does

not necessarily have the same result as testing. Testing may through errors

which have to be corrected; debugging in the sense of dealing with errors as they

become evident but otherwise “leaving well alone” , may leave at any stage some

section of programs untested.

Ideally, the program should be tested without possible combinations of inputs

and its output for each case checked against pre calculated correct results.

Testing must be focused on the validation of small, separate parts of the program

which do have general. The testing, takes overall constructions, proceeds from

the top to the downwards. Testing of a modular program starts with the main

module in an environment where all other module is simulated.

As each module is validated it can be added to the structure and its subordinate

modules can be investigated. After the test short, the program output must be

compared with the pre calculated results, and if the program is at fault then the

error must be found and tested. Program testing ends when the program has

been successively through all of its logical paths.


SYSTEM IMPLEMENTATION

Operational systems are quickly taken for granted. Every system requires

periodic evaluation after implementation. A post implementation review measures

the system’s performance against predefined requirements.

Unlike system testing, which determine where the system fails so that the

necessary adjustments can be made, a post implementation review determines

how well the system continues to meet performance specification. It is after the

design and conversions are complete. It also provides information to determine

whether major redesign is necessary.


HARDWARE & SOFTWARE REQUIREMENTS

1) HARDWARE:

Processor : Pentium IV

RAM : 128 MB

Graphics Card: Intel(R) 82845G/PE/GV Graphic Controller.

CD ROM : CD ROM 48X/52X

Floppy Drive : 1.44 MB.

Monitor : Colored screen

2) SOFTWARE:

 Platform: Microsoft Windows/DOS

 Turbo C++
BIBLIOGRAPHY

NAME OF BOOK AUTHORS NAME

Object oriented Programming---------------------------------E.Balaguruswamy

C++ program design---------------------------------------------G.S.Baluja

Computer Fundamentals---------------------------------------Sumita Arora


SYSTEM STUDY

A system study is conducted to learn the details of the current business situation

information gathered through the system study forms the basis for creating

alternate design strategies.

System study consists of the following :

 Technical study

 Operational study

 Economic study

TECHNICAL STUDY:

Technical study determines whether the organization has the technology and the

skills necessary to carry out the project, and if not how they should be obtained.

In the proposed system, the existing technology satisfies the need for the system

that is available. Therefore, the system is feasible.

OPERATIONAL STUDY:

Operational study determines if the proposed system satisfies the user objectives

and can be fitted into the current system operation. Our proposed system will

certainly satisfy the objectives and it will enhance their capability. The proposed
system can be best fitted instead of the current system operation. Therefore, the

system is operationally feasible.

ECONOMIC STUDY:

Economic study determines whether the project goal can be achieved within the

resource limits allocated to it. It must also determine whether it is worthwhile to

proceed with the project at all or whether the benefits obtained from the new

system are not worth the cost.

After conducting cost benefit analysis, it reveals that the objectives of

proposed system can be achieved within the allocated resources. Proposed

system does not require much extra workforce. Labour cost is almost nil.

Therefore, the system is economically feasible.


TESTING

Software testing is crucial element of the software quality assurance and

represents the

Ultimate review of specification, design and coding. Software testing

fundamentals define the overriding objectives for software testing. Test case

design focuses on a set of objectives. Here we discuss the testing technique that

has been applied on our project. Basically there are two testing strategies. Code

testing where the strategy examines the logic of the program. Specification

testing where the program is treated the the black box, here the instruction path

is not considered.

Apart from the above there are also some levels of test

1) Unit testing

2) System testing

3) Peak load testing

4) Performance testing

5) Recovery testing

6) Procedure testing

7) Human factors testing

In that case code-testing strategy is adapted where the entire logic of the

program is examined. Also specification testing is implemented at the end, where

the system is tested with the real data.


UNIT TESTING:

The first level of testing is called unit testing. In that, different modules are tested

against the specifications produced during design for the modules. Unit testing

essentially for verification of the code produced during the coding phase, and

hence the goal is to test the internal logic of the modules.

The modules interface is tested to ensure that information properly flows into and

out of the program unit under test. The local data structure is examined to ensure

that data stored temporarily maintains its integrity during the steps in an

algorithm’s execution.

SYSTEM TESTING:

The next levels are system testing and acceptance testing. Here the entire

software system is tested. The reference document for those process is the

requirements document, and the goal to see if the software meets its

requirements. This is essentially a validation activity. Testing here focuses on the

external behavior of the system. The internal logic of the program is not

emphasized.

System testing is actually a series of different tests whose primary purpose is to

fully exercise the computer-based system. Although each testing has a different

purpose, all work to very that all the system elements have been properly

integrated and perform allocated functions.


ACCEPTANCE TESTING:

Acceptance testing is performed with realistic data of the client to demonstrate

that the software is worked satisfactorily. The testing will be done at the client’s

environment with the actual data present there.

TEST CASE DESIGN:

The design of tests for software and other engineered products can be the

challenging as the initial design of the product itself. Yet for reasons that we have

already discussed, software engineers often treat testing as an after though,

developing test case that may” fees right” but have recalling the objectives of

testing.

RECOVERY TESTING:

The first level of testing is called unit testing. The unit testing method where unit

testing will be taken at a time thoroughly at a statement level to find maximum

error.

INTEGRATION TESTING:

The next level of testing is integrated testing. Many test modules are combined in

to sub systems, which are tested, are known the integration testing. In that, the

system is tested at the inter face between sub systems the explained in the

design process.
VALIDATION :

The system has been tested and implemented successfully and thus ensures

that the entire requirement the listed in a software requirement specifications are

completely full fill-In case of error, corresponding error message will be

displayed.

For example, if the user enters a password, the system automatically prompts for

the error checking. Such validation checks will hold good to all the forms.
APPENDIX

IN-BUILT FUNCTIONS

C++ Provides number of inbuilt functions.These functions has inbuilt coding in

different header files.We can use these functions for our specific use only.These

are:

. _setcursortype().selects cursor appearance.

. Clrscr ().clrscr clears the current text window and places the cursor in the upper

left-hand corner (at position 1, 1).

.fclose().fclose closes the named stream.

.fopen ().fopen opens a file and associate a stream with it. Both functions return a

pointer that identifies the stream in subsequent operations.

.fread ().fread reads a specified number of equal-sized data items from an input

stream into a block.

.fwrite ().fwrite appends a specified number of equal-sized data items to an

output file.

.getch ().getch reads a single character directly from the keyboard, without

echoing to the screen.

.getche ().getche reads a single character from the keyboard and echoes it to the

current text window, using direct video or BIOS.

Getdate ().gets or DOS system date.


.getmaxx ().getmaxx returns the maximum x values (screen-relative) for the

current graphics driver and mode.

.getmaxy ().getmaxy returns the maximum y value (screen-relative) for the

current graphics

Driver and mode.

.getmaxcolor ().getmaxcolor returns the highest valid color value that can be

passed to set color for the current graphics driver and mode.

.getpalette ().getpalette fills the palette type structure*palette with information

about the current palette’s size and colors.

.gets ().gets returns wh en it encounters a newline; everything up to the new line

is copied into s.

.gotoxy ().gotoxy moves the cursor to the given position in the text current text

window.If the coordinates are invalid, the call to gotoxy is ignored.

.graphresult ().graphresult returns the error code for the last graphics operation

that reported an, than resets the error level to grOK.

.initgraph().To start the graphics system, you must first call initgraph.Initgraph

initializes the graphics system by loading a graphics driver from disk(or validating

a registered driver)then putting the system into graphics mode.Initgraph also

resets all graphics settings (color,palette,current position,viewport,etc.)To their

defaults, then resets graph result to 0.

.malloc ().malloc allocates a block of size bytes from the memory heap. It allows

a program to allocate memory explicitly the it’sneeded, and in the exact amounts

needed.
.outtext ().outtext displays a text string, using the current justification settings and

the current font, direction, and size, outtext outputs text string at the current

position(cp).

.outtextxy ().outtext displays a string at the specified location (graphics mode)

.printf ().printf sends formatted output to stdin.

.putc ().putc outputs the character given by c to the stream given by stream.

Putchar ().putchar is a macro defined the putc(c, stdout) putchar puts the

character given by c on the output stream stdout.

Open ().opens a file for an fstream.

.write ().write writes a buffer of data to a file or device.

.puts ().puts copies the null-terminated strings to the standard output stream

stdout and appends a new line character.

Read ().read attempts to read bytes from a file into a buffer.

.setbkcolor ().setbkcolor sets the current background color using the palette

COLORS (text mode)

.set color ().set color sets the current drawing color to color, which can range

from 0 to getmaxcolor.

.setfillstyle ().setfillstyle sets the current fill pattern and fill color.

.setline style ().setline style sets the style for all lines drawn by line, lineto,

rectangle, drawpoly, etc.

Settextstyle ().settextstyle sets the text font, the direction in which text is

displayed, and the size of the characters.


.settextjustify ().sets text justification for graphics mode settextjustify affects text

written with outtext and can’t be used with text-mode and stream functions.

.setwritemode ().sets the writing mode for line drawing in graphics mode.

.strcat ().strcat () appends a copy of src to the end of dest.The length of the

resulting string is strlen (dest) +strlen (src).

.strcpy ().copies string scr to dest, stopping after the terminating null character

has been moved.

Strlen ().calculates length of a string.Returns the number of character in s, not

counting the terminating null character.

Strncpy ().copies at most maxlen character of src to dest. The target string, dest,

might not be null-terminated if the length of src is maxlen or more.

.strupr ().converts to all lowercase.

.toupper ().Translate characters to uppercase.

.textbackground ().textbackground selects a new text background color.

.textwidth.textwidth takes the string length, current font size, and multiplication

factor, and determinnes the width of textstring in pixels. These functions are

useful for adjusting the spacing between lines, computing viewport heights, sizing

a title to make it fit on a graph orin a box, etc.

Textmode (). Changes screen mode (in text mode). When text mode is called,

the current window is rest to the entire screen, and the current text attributes are

reset to normal,corresponding to a call to normvideo. Specifying LASTMODE to

textmode cause the most recently selected text mode to be reselected.textmode

should be used only when the screen is in text mode,(presumably to chnge to a


different text mode). When the screen is in graphics mode, use restorecrtmode to

escape temporarily to text mode

.void ().Empty data type.When used the a function return type, void means that

the function does not return a value.


CODING

#include<fstream.h>

#include<dos.h>

#include<conio.h>

#include<stdlib.h>

#include<stdio.h>

#include<string.h>

#include<iomanip.h>

#include<graphics.h>

class group

private:

struct person

char flag;

char empcode[5];

char name[40];

int age;

float sal;

int day;

int month;
int year;

}p;

fstream file;

public:

group();

void addrec();

void listrec();

void modirec();

void delrec();

void recallrec();

void packrec();

void exit();

};

void main()

char choice,v;

group g;

do

{
clrscr();

struct dosdate_t d;

_dos_getdate(&d);

// p.day=d.day;

// p.month=d.month;

// p.year=d.year;

// _dos_getdate(&d);

gotoxy(12,5);

textcolor(6);

cprintf("Todays date:");

printf("%d",d.day);

cout<<"/";

printf("%d",d.month);

cout<<"/";

cout<<d.year;

gotoxy(12,9);

cout<<"MICROTEK.Corporation Pvt.Ltd";

gotoxy(12,12);

cout<<"1.Add record";

gotoxy(12,15);

cout<<"2.List Record";

gotoxy(12,17);

cout<<"3.Modify record";
gotoxy(12,19);

cout<<"4.Delete record";

gotoxy(12,21);

cout<<"5.Recall record";

gotoxy(12,23);

cout<<"6.Pack record";

gotoxy(12,25);

cout<<"0.Exit";

gotoxy(12,28);

cout<<"Your choice"<<" ";

cin>>choice;

clrscr();

switch(choice)

case '1':

g.addrec();

break;

case'2':

g.listrec();

break;

case'3':
g.modirec();

break;

case'4':

g.delrec();

break;

case'5':

g.recallrec();

break;

case'6':

g.packrec();

break;

case'0':

g.exit();

exit(1);

while(choice!=0);

}
void group::group()

file.open("Emp.dat",ios::binary|ios::in|ios::out);

p.flag=' ';

if(!file)

cout<<endl<<"Unable to open file";

exit();

void group::addrec()

char ch;

file.seekp(0L,ios::end);

struct dosdate_t d;

_dos_getdate(&d);

p.day=d.day;

p.month=d.month;

p.year=d.year;
cout<<"Make shure that no employee has the same code"<<endl;

do

cout<<endl<<"Enter employee code, name, age & salary:"<<endl<<endl;

cout<<"OR"<<endl<<endl;

cout<<"To return to the Main menu press'm' key else press'a':";

cin>>ch;

if(ch=='m'||ch=='M')

main();

cin>>p.empcode>>p.name>>p.age>>p.sal;

p.flag=' ';

file.write((char*)&p,sizeof(p));

cout<<"Add another record ?(y/n) :";

cin>>ch;

while(ch=='y'||ch=='Y');

void group::listrec()

int j=0,a;

file.seekg(0L,ios::beg);
cout<<"List of records present are as under>>>"<<endl<<endl;

cout<<" "<<"|CODE|"<<" "<<"|NAME|"<<""<<"|AGE|"<<"

"<<"|SALARY|"<<" "<<"|DATED|"<<endl;

//Donot touch Above Line Any Way it is set to give Some Nice

Look

while(file.read((char*)&p,sizeof(p)))

if(p.flag!='*')

cout<<endl<<"Record#"<<""<<j+

+<<setw(6)<<p.empcode<<setw(20)<<p.name<<setw(4)<<p.age<<setw(9)<<p.s

al<<" "<<p.day<<"/"<<p.month<<"/"<<p.year<<endl;

file.clear();

if(j==0)

gotoxy(10,10);

cout<<"No record exit";

gotoxy(10,11);

cout<<"Press any key...";

getch();
}

else

cout<<endl<<"Press any key...";

getch();

void group::modirec()

char code[5];

int count=0;

long int pos;

cout<<"Enter employee code whose record is to be modified :";

cin>>code;

file.seekg(0L,ios::beg);

while(file.read((char*)&p,sizeof(p)))

if(strcmp(p.empcode,code)==0)

cout<<endl<<"Enter new record "<<endl;

cout<<endl<<"Enter employee name,age & salary :"<<endl;

cin>>p.name>>p.age>>p.sal;

struct dosdate_t d;
_dos_getdate(&d);

p.day=d.day;

p.month=d.month;

p.year=d.year;

p.flag=' ';

pos=count*sizeof(p);

file.seekp(pos,ios::beg);

file.write((char*)&p,sizeof(p));

return;

count++;

cout<<endl<<"No employee in file with code= "<<code;

getch();

file.clear();

void group::delrec()

char code[5];

long int pos;

int count=0;

cout<<"Enter employee code to be deleted :";

cin>>code;
file.seekg(0L,ios::beg);

while(file.read((char*)&p,sizeof(p)))

if (strcmp(p.empcode,code)==0)

p.flag='*';

pos=count*sizeof(p);

file.seekp(pos,ios::beg);

file.write((char*)&p,sizeof(p));

return;

count++;

cout<<endl<<"No employee in file with code="<<code;

cout<<endl<<"Press any key...";

getch();

file.clear();

void group::recallrec()

char code[5];

long int pos;

int count=0;
cout<<"Enter employee code to be recalled :";

cin>>code;

file.seekg(0L,ios::beg);

while(file.read((char*)&p,sizeof(p)))

if(strcmp(p.empcode,code)==0)

p.flag=' ';

pos=count*sizeof(p);

file.seekp(pos,ios::beg);

file.write((char*)&p,sizeof(p));

return;

count++;

cout<<endl<<"No employee in the file with code="<<code;

cout<<endl<<"Press any key...";

getch();

file.clear();
}

void group::packrec()

ofstream outfile;

outfile.open("TEMP",ios::out);

file.seekg(0,ios::beg);

while(file.read((char*)&p,sizeof(p)))

if(p.flag!='*')

outfile.write((char*)&p,sizeof(p));

outfile.close();

file.close();

remove("Emp.DAT");

rename("TEMP","EMP.DAT");

file.open("EMP.DAT",ios::binary|ios::in|ios::out|ios::nocreate);

gotoxy(10,10);

cout<<"Marked records to be deleted are all removed";

gotoxy(10,11);

cout<<"press any key....";

getch();

}
void group::exit()

file.close();

}
SYSTEM ANALYSIS

At the heart of systems analysts is a detailed understanding of all-important

facets of the area under investigation, (for this reason, the process of acquiring

this information is often termed as detailed investigation). I had worked closely

with the employees and the management and they had understood the business

process to answer these key questions.

• What is being done?

• How is it being done?

• How frequently does it occur?

• How great is the volume of transactions or decisions?

• How well is the task being performed?

• Does a Problem Exist?

• If a problem exists, how serious is it?

To answer these questions, I talked to a variety of people to gather details about

the business process and their opinions of why things happen as they do and

their ideas for changing their the process.


REQUIREMENT ANALYSIS FOR THE PROPOSED
SYSTEM

MEETING AND DISCUSSIONS


Before deciding the system design and the outputs desired, I had met with the workers and
employees several times and every time I went with new concepts in mind and new designs in
mind, the model which was designed was after seven meetings on the same design.

SECONDARY DATA
Before starting on the development of new system I had to look for the old records in the books
previously it was done manually and their records are maintained on register and account books.

LIVE DEMONSTRATION
It’s pleasure and luck of me that Water Department has given me chance to see the actual
process. All these processes are somehow related to each other and each activity has its own
specialty. And keeping track of those records were not easy. So it had given actual idea of what
will the inputs and the outputs.

As the details are gathered the I study the data requirements to identify features the new system
should have, including both the information the system should produce and operational features
such as processing controls, response times, and input and output methods.
EXISTING SYSTEM AND PROPOSED SYSTEM
EMPLOYEE MANAGEMENT SYSTEM of Water Department is a Government
System of Management Information System (MIS). Existing system is manual,
which is creating a lot of problems for PHE. The system in its usual form takes a
lot of time and doesn’t support the choice of the customers. Water Billing is
taking a lot of time, which is decreasing the efficiency of the work & other
activities. Inventory are not maintained properly in the record books.

Limitations Of the Existing System

1. Not very user-friendly.


2. Security problems.
3. Lengthy procedures.
4. Requires a lot of manpower and human effort.
5. Time consuming.
6. Not able to provide effective management reports.
PERFORMANCE REQUIREMENTS FOR THE PROPOED SYSTEM

The following performance characteristics were taken care of in developing the


systems:

• User Friendliness

The system is easy to learn and understand. A naïve user can also use the
system effectively, without any difficulty.
• User Satisfaction
The system is such that it stands up to the users expectations.

• Response Time

The response time of all the operations is very low. This has been made possible
by careful programming.
• Error Handling
Response to User Errors and undesired situations have been taken care of to
ensure that the system operates without halting in case of such situation and
proper error messages are given to user.

• Robustness

The system recovers from undesired events without human intervention.

• Security

The system provides protection of information through the mechanism of


password incorporated in it. Therefore, only authorized people can access the
databases.

• Accuracy

The system is accurate. Thus, its utility is very high.

• Portability
The system can be moved to a new hardware / operating system after making
minor modification to it.
ACCEPTANCE CRITERIA OF THE PROPOSED SYSTEM

The following acceptance criteria were established for the evaluation of the new
system

1. The system developed should be accurate and hence reliable i.e. the error
rate should be minimized and the outputs should be consistent and correct.

2. The developed software should provide all the required functions. Further,
both the execution time and the response time should negligibly low. It should
also satisfy the criteria specified in functional and performance requirements.
3. The system should be efficient i.e. the resource utilization should be
optional.

4. The system should have scope to for see modifications and


enhancements i.e. it should be able to cope with business changes.

5. The system must satisfy the standards of a good software:

5.1 User Friendliness : The system should meet user needs and should be
easy to use.

5.2 Modularity : The system should have relative independent and single-
function parts that can be put together to make the complete system.

5.3 Maintainability : The system should be such that future maintenance and
enhancement times and efforts are reduced.
5.4 Timeliness : The system should operate well under normal, peak and
recovery conditions.
COMPUTER BASED SYSTEM
The elements of a computer based System will be having following features
. Software
Computer programs and related documentation that serve to affect the logical
method; procedure or control are required.
. Hardware
Electronic devices (CPU etc.) that provide computing capability and scanners
etc., that provides external world function.
. People
Users and operators of the Hardware and Software.
. Database
A large, organizes collection of information that is accessed by the software and
is an integral part of the system function.
. Documentation
Manuals, forms and other descriptive information that portrays the use and/or
operation of the system.
SYSTEM CONCEPT

Before going to design a system one should know what system means to be
Basically system is an integrated collection of components which satisfy
functions necessary to achieve the system’s goals and which have relationships
to one another that give cohesion to the system and define its structure. Basically
systems consists of three processes

 Input
 Processor
 Output

All these processes are done by me, where I had collected the input
requirements from the user, I had designed the input structure, and for obtaining
output, user don’t know the type of process which had gone through in the
software. Conversion of input into output is called as processor. Only
programmer, I only had gone through the process between the process between
the input and output, knows processing process.

A system concept is obtained as per the need of the user. The system concept
comes in business information concept or simply information concept for the
user.
To approach towards the development of information system, knowledge
of software engineering is necessary.

SOFTWARE ENGINEERING
With the advent of software with such a force it has, become necessary for me to
become acquainted with the rules and regulations laid down during the making of
a project. In other words it has become essential for me to know the concepts of
software engineering.

Hence before I go on to describe my project – ‘EMPLOYEE MANAGEMENT


SYSTEM’, I will briefly describe the steps of making a good project.

The steps of software engineering will be dealt with as per the following
categories:

1. Characteristics of software
2. Problems faced by software developers
3. Project process management
4. Estimation
5. Risk analysis

The Importance of software

During the time when computer was introduced the main point of focus was the
hardware. There was a need to develop computers with fast processing speed.

But reduced cost as the advancements kept taking place in the field of hardware;
there was a need to develop better software.
Software became more important due to following reasons:

a. Hardware sophistication has outpaced to build software to tap hardware


potential.
b. Our ability to build new programs cannot keep pace with the demand for
new programs.
c. Our ability to maintain existing programs is threatened by poor design and
inadequate resource.

Software characteristics

To efficiently develop a good project it is important to be aware of software


characteristics:

1. Software is developed or engineered, and not manufactured i.e. they don’t


introduce quality problems that are present in hardware.
2. Software doesn’t wear out i.e. it always exists but might decorate.
3. Most software is custom built, rather then being assembled from existing
components.

Problems faced by software developers.

1. Schedule and time cost estimates are gross.


2. The software productivity has not kept up with its demands
3. The quality of software is sometimes not adequate.
SOFTWARE PROCESS MODEL

In order to route towards development of software or to solve actual problem in


an industry setting, a software engineer must incorporate for a development
strategy that encompasses the process, methods and tool layers and the generic
phases. This strategy is often regarded as a process model or a software
engineering paradigm. The process model used by me is a prototyping model.

The prototyping paradigm begins with requirements gathering. Developer and


customer meet and define overall objective for the software; identify whatever
requirements are known and outline areas where further definition is mandatory.

Build/Revise
Mock-up

Listen to
customer

Customer
Test drive
mockup

It is true that customer and developer like the prototyping paradigm. User gets a
feel of the actual system and developer gets to build something immediately.

Since project duration is of short period, so quick action has to be taken to build a
system. Best source is the Rapid Application Development.

Rapid Application Development (RAD) is a linear sequential software


development process model that emphasizes on extremely short development
cycle. RAD process enables the development team to create a fully functional
system with in a very short time period.

RAD assumes the use of four-generation techniques. Rather than creating


software using conventional third generation programming languages, the RAD
process works to reuse existing program components or create reusable
components. Since RAD uses reuse of code, most of the code is already tested.

PROJECT MANAGEMENT PROCESS


Software project management is the first layer of the software engineering
process.
In order to conduct a successful software project I must understand a scope of
work to be done, the risks to be incurred, the resources to be required, the tasks
to be accomplished, the milestones to be tracked, the cost and the schedule to
be followed.
DESIGNING OF THE DATABASE

In the system design phase, one of the challenging tasks is the database design,
because the whole valuable data of any Organisation is stored in the database.

Thus while designing the new system; I had first designed database using the
back-end Notepad consisting of all the tables required for the system. The
database is so designed as to minimize redundancy and is designed after
performing various forms of normalization on the preliminary designed tables.

• Identifying the entities: All the entities related to the module were identified,
checked and consolidated.

• Identifying the relationships: The relationships between entities, within and


outside the system were identified.

• Attributes definition: The pertaining to the entities were identified and their
field characteristics were specified.

• Normalisation: The entities were normalised. After first and second


normalisation, third normalisation was achieved for all the entities of system.

• Interface: Interfacing with other systems was done and attributes related to
external entities were identified.

• Fast Path Table Mapping

Tables were created for the system using fast path table mapping. This has
provision to map the entities and attributes into tables. The name of the entity is
taken as the table name.
• Default Database Design

This utility creates column and constraint definitions from the entity model and
the table/entity mapping entered in CASE* Dictionary. This database design
can be

refined according to your application regarding using the tables, columns and
key constraint definition screens to make amendments.

The steps involved here were :

1. Generation of table (DDL) script.

2. Check constraints.

3. Primary keys

4. Unique keys

5. Foreign keys

• Program Specifications

The program specifications were written for the masters, transactions, reports
and queries. The logic for each field, block and form were written so that
anyone who doesn’t know the system will be able to code the logic. Field
Validations and user-friendly error messages were written as a part of the
program specifications.
This is done mainly for two reasons:

1. Saving the development time


As the procedure will be common to many programs, the development
time will be saved substantially.

2. Testing becomes easier


As the procedure becomes an independent entity, it can be easily tested.
SOFTWARE DEVELOPMENT TOOLS

Software developers may install purchased software or they may write new

custom- designed program. Choice depends on the cost of each option, time

available to write software and the availability of programs

Typically, in larger organizations computer programmers are part of permanent

professional staff. In smaller firms, without programmers, outside programming

services may be retained on contract basis.

Programmers are also responsible for documenting the program, providing an

explanation of how and why certain procedures are coded in specific ways.

Documentation is essential to test the program and carry on maintenance once

the application has been installed.

Before starting coding of a system we are required to carefully study the

information and requirements regarding that application, stored in Access Case

Dictionary. Once the problem was well though off, and ideas were

shared/discussed among other team members about how exactly the user

interface should be and what is the best way to deduce the logic of the

application.
PROCESS LOGIC

Process logic of the software is very simple and lengthy. It requires an information

transfer. In material management section, we are using raw materials and other spares

for the production process. When it is required for production, inventory of the raw

material is updated in the database. Stock of the finished goods is also maintained

separately in the database which is used while selling, distributing and exporting

finished products to the dealers and customers.

The stores department does dispatching and issuing, which is also stored in the

database. Receipt in and issuance from stores leads to proper entries in stores inventory.

All the financial process starts with the preliminary step of the accounting i.e.

from the journal entries. After submitting journal entries all the financial reports

will be generated by the system. So a large number of database is maintained for

such type of outputs.


TESTING OF SOFTWARE

During systems testing, the system is used experimentally to ensure that the
software doesn’t fail i.e., that it will run according to its specification and in the
way user expect. Special test data are input for processing, and the results
examined. A limited number of users may be allowed to use the system so
analysts can see whether they try to use it in unforeseen ways. It is preferable to
discover any surprise before the organization implements the system and
depends on it.

In many organizations, testing is performed by person other than those who


wrote the original programs to ensure more complete and unbiased testing and
more reliable software.

The norms that were followed during the phase were that after the developer the
software has satisfied himself regarding every aspect of the software under
consideration, he is required to ‘Release’ the program source code. A shell script
name Release used to copy the named file (s) from developer’s user area to a
project coordinator area, in the directory name with developer user name. Here
all the final testing used to be done by persons other than developers himself. If
some changes were desired in the program, the developer is required to use
another script named ‘Retrieve’, which copied back the latest version of the
program to developer’s area.

As in the system data is entered at different levels, I considered providing various


types of checks like range check, validity check, completeness check, etc. in
different data entry screens according to the requirements.

Since the users are not familiar to the new system, the data screens were
designed in such a way that they were:
• Consistent

• Easy to use

• Had a fast response time


The quality of an information system depends on its design, development, testing
and implementation. One aspect of systems quality is its reliability. A system is
reliable if, when used in a reasonable manner, it does not produce failures that
are dangerous or costly.

Although its is virtually impossible to develop software that can be error-free,


software developers strive to prevent the occurrence of errors, using methods
and techniques that include error detection and correction and error tolerance.
Both these strategies are useful for keeping the system operating and preventing
failures.

Quality assurance also includes testing to ensure that the system performs
properly and meets the requirements. Special cases of testing are validation,
verification and certification.
The purpose of testing is to find errors and not to prove correctness. The
software processes test cases, Using life or artificial data, and errors are
reported.

Two testing Strategies are:

 Code testing: the analyst or programmer develops test cases to execute

every instruction and path in a program.

 Specification testing: the analyst examines the program specification


and then writes test data to determine how the program operates under
specific conditions.
We have tested our system using above methods; we used both live and
artificial data to test the system.

Other Extensive TESTING PROCEDURES were followed, which included


following

UNIT TESTING

Unit Testing is the testing of a single program module in an isolated environment.


Testing of the processing procedures is the main focus.

INTEGRATION TESTING

Integration testing is the testing of the interfaces among system modules. In


other words, it ensures that the data moving between the modules is handled as
intended.

SYSTEM TESTING

System testing is the testing of the system against its initial objectives. It is done
either in a simulated environment or in a live environment.

STRESS TEST

Applying Stress to a program means that a large amount of data is fed for
processing in a short period of time. In other words, consumption of computer
resource is drastically raised in that time frame with the intention to ensure that
the system will still perform effectively if the same condition occurs in the future.

TEST REVIEW

Test Review is the process which ensure that testing is carried out as planned.
Test Review decides whether or not the program is ready to be shipped out for
implementation.
For each data entry screen, I prepared test data with extreme values and tested
under all relevant test condition. It was extensively tested that all shell scripts,
package, database functions are behaving in the manner as expected of them
and giving accurate results. After my own satisfaction, I invited the concerned
users to test the relevant data-entry screens against real data. This process
helped in rectifying/modifying the modules time and again.
IMPLEMENTATION AND EVALUATION

Implementing a system, whether a new one or an existing one that has been
modified, consists of three primary activities:

1) Training
2) Conversion
3) Post implementation Review (Evaluation)

1) Training

Most user training deals with the operation of the system itself, with the most
attention given to data-handling procedures. It is imperative that users be
properly trained in methods of entering transactions, editing data, formulating
inquiries, and deleting records.
We had given on-site training to the owner and employees of the firm.

2) Conversion

It is the process of changing from old system to a new one. It must be carefully
planned and executed. There are mainly four methods present:

i) Parallel system
ii) Direct cutover
iii) Pilot approach
iv) Systems phase-in

We had planned the parallel System approach, in which records are stored
parallel in the system and also manually.
By this method we can achieve greatest security in the Installation.
Post-Implementation Review (Evaluation)

After the system is implemented and the conversion is complete, a review is


conducted to determine:

a) Whether the system is meeting expectations?

b) Where improvements are needed?

When our system was implemented and conversion was complete, we allowed
the user to use the system for one week and he gave us the following feedback.

1) The system is meeting the objectives that were decided.

2) The design of the system is user-friendly.

3) Some additions should be there like

There should be flexibility in Report generation i.e. reports should be available for
daily, weekly, monthly, quarterly and yearly basis.

User also wanted to create us or provide the facility of accounting.


SYSTEM EVALUATION

Evaluation of the system is performed to identify its strengths and weakness.

OPERATIONAL EVALUATION
In this, assessment of the manner in which the system functions, including ease
of use, response time suitability of information’s formats, overall reliability, and
level of utilization is undertaken.

All the above aspects were very well taken into considerations from the very
beginning. In fact one of the user felt that they were reduced to nothing because
of the ease with which system runs, all they have to do is select from the list of
values available at every possible field in screen and press return. They don’t
have to keep checking the status of the job they are doing, since every job is on-
line and all information and messages flash at screen.

The reliability is very high and till the writing of this document, the system have
not ever failed. All the recovery methods are well written, even if something
exceptional offers it sees to it that user has a way to come out of the undesirable
situation and carry on with the work. The committing takes place when everything
goes normal.

As for as the level of utilization is concerned, is one of the busiest activity with the
orders pouring in round the clock, so the system has been utilized heavily and it
has responded favorably to the users expectations.
ORGANIZATION IMPACT

It includes identification and measurement of benefits to the organization in such


area as financial concerns (cost, revenue, and profit), operational efficiency, and
competitive impact. Also include impact on internal and external information
flows. Then the rewriting of the application on new platform of course had cost a
fortune to the company, however in the long term planning it will certainly prove
beneficial. Since the response time and throughput has increased by manifolds,
the processing would increase, hence resulting in more revenues and profit for
the

company. Especially with the increase in the ease in processing it can schedule
their manpower accordingly rather than tying up personnel for specific
application. This will rejuvenate and boost the morale of the users. This system
will go on to strengthen its leadership in the market.
DEVELOPMENT PERFORMANCE

It includes evaluation of the development process in accordance with such


yardstick overall development time and effort, conformance to budgets and
standards, and project management criteria. Includes assessment of
development methods and tools.

By all means our development performance was fairly good as the project was
completed within budgets and there was no schedule slippage, target dates were
met, all along the standards that were followed were consistent.
SOFTWARE MAINTENANANCE

Once a system has been installed and is fully operational, the systems
maintenance task looms large. It is generally assigned to a systems and
programming group consisting of maintenance programmers. Thus the
responsibility gets transferred from a systems development team to a
maintenance programming team.

Systems maintenance involves keeping the software operational i.e. undertake


preventive measures to keep computer programs current, monitor and fix
problems with computer programs in response to new user requirements. Thus,
since part of a system has to be modified rather than the entire system,
maintenance activities resemble miniature systems development efforts.

Systems maintenance that are considered during the development of the system

1. Adaptive Maintenance
2. Corrective Maintenance
3. Perfective Maintenance
ADAPTIVE MAINTENANCE

This is performed with a view to keeping the software current. As internal


business

Conditions change, the data processing requirements also change. Naturally,


an

Organisation must modify its operational software accordingly.

The adaptive maintenance begins with a request for service from the user. This may be
assessed by the committee. Once approved, it goes to the maintenance programmers
who treat it as mini systems development assignment. The maintenance programmer
must define system modification requirements, after the logical design and technical
design and revise the data dictionary to record modifications to terms used in
constructing system diagrams and Input/Output formats
In addition, adaptive maintenance also includes other housekeeping tasks
CORRECTIVE MAINTENANCE

This is performed in response to software failure. The errors that occur can be
classified as:

1. Program logic errors such as inadequate data validation procedures,


data type errors, inconsistent use of variable names, incomplete logical paths
etc
2. System errors may consist of hardware problems or with software
design
3. Operations errors can be traced to computer operations, computer
schedules and other members of the operating staff. The errors may be
loading incorrect tape file, improper back up of computer files, failure to
change printer ribbons etc.
4. Users errors can be directly to user groups. These errors suggest
deficiencies in training demonstration, and user guides.

A solution to this is in the form of module repairing which is the redesign of error
prone modules in an implemented software system.
PERFECTIVE MAINTENANCE

This is performed to improve or maintain program efficiency. Modifying program


data structures is one way to improve overall program efficiency. Backing
records, storing precomputed results, and eliminating run times. Another way to
improve efficiency is to modify expensive parts of a system, improving loops,
test comparisons, calls to external procedures and evaluation of algebraic
expressions illustrates ways of improving overall speed of processing.
SOFTWARE SECURITY

The term system security describes the physical protection of computer


hardware, tape reels, disk packs, source documents and documentation manual
as well ad the logical protection of the computer files and programs. There are
instances where kids electronically break into computers in the U.S. With the
onset of communication innovations even privacy and society’s moral fabric are
threatened. It is said that stealing secrets from computers is more profitable than
robbing banks. Naturally, this calls for a workable security to protect the system
from physical as well as logical results.

Physical Security

Computer equipment and files are valuable physical assets that should be

protected. Four general safeguards include

1. Locating the computer in a safe place.

2. Protecting computer rooms.

3. Protecting computer files.

4. Buying insurance.

Physical dangers include fire, flood, tidal wave, earthquakes and tornadoes. They
also include man-made riots, strikes, industrial accidents, loss of power etc. the
computers must be located away from the boilers, furnaces, fuel storage, heavy
engineering centres etc. for extinguishing fire, it is better to provide insert-gas fire
extinguishing as it avoids soaking computer equipment and files in water.
Limiting Protection

Limiting logical computer access is even more difficult than controlling physical
access. The businesses with remote dial up systems cannot rely only on physical
controls for computer security. Also the proliferation of person computer and its
possibility to connect to company mainframes has increased the chances of

Feeding with data deliberately by outsiders. A person with a microcomputer at a


remote place can use a phone line and illegally collect information without
leaving any clues. The control measures include 1) Identification 2) Access
control 3) Audit controls and 4) System Integrity

1) Identification: There are ways to identify persons who have accessed the
computer.

Password: a password is a set of alphanumeric digits has been assigned


to an individual authorized to use a computer system. In many
organisations the employee is given the opportunity to choose their own
passwords. This method is not foolproof for any person knowing the
personal habits of the user can detect the password. A better method mat
be to use randomly difficulty is that user himself will allow his friends and
others to use the password thereby defeating the purpose.

a) Using fingerprints and voice prints as identification method is make a


headway
b) Lock-out Systems: A lockout system protects against someone guessing a
correct password through trail and error methods. A typical lockout system
gives only three chances after which it automatically hangs up.
c) Encryption: data encryption refers to the translation of communicated data
into secret codes to safeguard the date during transMr.ion. The process
requires an encryption device for converting the original message into a
code and a decryption device to translate the code back into recognizable
text. The encryption method without intervention by human beings is very
secure

(ii) Audit controls: they protect a system from external security breaches and
internal frauds. In the MIS department, the programmer can pirate, modify and
even sell software. To control this, an audit trail is a must. The best control is
through self-regulating systems. Here the controls are built in each stage and
any violation is brought to notice immediately.

(iii) System Integrity: is another line of defence in system security. This


safeguards the functioning of hardware, database, software, physical security
and operating procedures.

COST ESTIMATION OF THE PROJECT

As the software are available with me and I don’t have to spend it on them.
Approximate cost of the project including learning tools and software will be
around 5,000.
SOFTWARE CONCLUSIONS

 It saves user’s time; software can show calculations in few minutes.

 It has reduced paper work to some extent.

 Reports generated by the system will drive the management towards its
goal.

 Suddenly with the advent of this system the lead-time has reduced to
some extent.

 The system had almost overcome the bottlenecks of previous system.

 It had reduced the burden of keeping and maintaining records in the


books.
SCOPE & RECOMMENDATIONS

The computer based information system continues to evolve throughout its life

cycle, even if it is successful. The present system will save user time and extra

labour that is spend on maintaining all the production process, stores and

accounting records.

This system can be further expanded to be a complete Enterprise Resource

Planning (ERP) package by further incorporating modules like Material

requirement planning, manpower planning, etc

Because of creative nature of the design, there remain some lapses in accurate

communication between the user and the developers. So, some aspects of the

system must be modified as operational experience is gained with it. As user

uses the system they may develop an idea for change or enhancement .
INTRODUCTION TO C++

C++ ("C Plus Plus", pronounced /ˌsiːˌplʌsˈplʌs/) is a general-purpose


programming language. It is regarded as a middle-level language, as it
comprises a combination of both high-level and low-level language features.[1] It
was developed by Bjarne Stroustrup in 1979 at Bell Labs as an enhancement to
the C programming language and originally named "C with Classes". It was
renamed to C++ in 1983.

C++ enjoys wide use in the software industry. Some of its application domains
include systems software, device drivers, embedded software, high-performance
server and client applications, and entertainment software such as video games.
Several groups provide both free and commercial C++ compiler software,
including the GNU Project, Microsoft, Intel, Borland and others.

The language began as enhancements to C, first adding classes, then virtual


functions, operator overloading, multiple inheritance, templates, and exception
handling among other features. After years of development, the C++
programming language standard was ratified in 1998 as ISO/IEC 14882:1998.
The current standard is the 2003 version, ISO/IEC 14882:2003. The next
standard version (known informally as C++0x) is in development.

C++ is a statically typed, free-form, multi-paradigm, compiled language where


compilation creates machine code for a target machine hardware. It supports
procedural programming, data abstraction, object-oriented programming, and
generic programming.
STANDARD LIBRARY

The 1998 ANSI/ISO C++ standard consists of two parts: the core language and
the C++ standard library; the latter includes most of the Standard Template
Library (STL) and a slightly modified version of the C standard library. Many C++
libraries exist which are not part of the standard, and, using linkage specification,
libraries can even be written in languages such as C, Fortran, Pascal, or BASIC.
Which of these are supported is compiler dependent.

The C++ standard library incorporates the C standard library with some small
modifications to make it work better with the C++ language. Another large part of
the C++ library is based on the STL. This provides such useful tools as
containers (for example vectors and lists), iterators to provide these containers
with array-like access and algorithms to perform operations such as searching
and sorting. Furthermore (multi)maps (associative arrays) and (multi)sets are
provided, all of which export compatible interfaces. Therefore it is possible, using
templates, to write generic algorithms that work with any container or on any
sequence defined by iterators. As in C, the features of the library are accessed
by using the #include directive to include a standard header. C++ provides 69
standard headers, of which 19 are deprecated.

The STL was originally a third-party library from HP and later SGI, before its
incorporation into the C++ standard. The standard does not refer to it as "STL",
as it is merely a part of the standard library, but many people still use that term to
distinguish it from the rest of the library (input/output streams,
internationalization, diagnostics, the C library subset, etc.).

Most C++ compilers provide an implementation of the C++ standard library,


including the STL. Compiler-independent implementations of the STL, such as
STLPort, also exist. Other projects also produce various custom implementations
of the C++ standard library and the STL with various design goals.
Language features

C++ inherits most of C's syntax and the C preprocessor. The following is a Hello
world program which uses the C++ standard library stream facility to write a
message to standard output:[5][6]

#include <iostream> // provides std::cout

int main()
{
std::cout << "Hello, world!\n";
}
OPERATORS AND OPERATOR OVERLOADING

C++ provides more than 30 operators, covering basic arithmetic, bit


manipulation, indirection, comparisons, logical operations and more. Almost all
operators can be overloaded for user-defined types, with a few notable
exceptions such as member access (. and .*). The rich set of overloadable
operators is central to using C++ as a domain specific language. The
overloadable operators are also an essential part of many advanced C++
programming techniques, such as smart pointers. Overloading an operator does
not change the precedence of calculations involving the operator, nor does it
change the number of operands that the operator uses (any operand may
however be ignored).

Templates

C++ templates enable generic programming. C++ supports both function and
class templates. Templates may be parameterized by types, compile-time
constants, and other templates. C++ templates are implemented by instantiation
at compile-time. To instantiate a template, compilers substitute specific
arguments for a template's parameters to generate a concrete function or class
instance. Templates are a powerful tool that can be used for generic
programming, template metaprogramming, and code optimization, but this power
implies a cost. Template use may increase code size, since each template
instantiation produces a copy of the template code: one for each set of template
arguments. This is in contrast to run-time generics seen in other languages (e.g.
Java) where at compile-time the type is erased and a single template body is
preserved.

Templates are different from macros: while both of these compile-time language
features enable conditional compilation, templates are not restricted to lexical
substitution. Templates are aware of the semantics and type system of their
companion language, as well as all compile-time type definitions, and can
perform high-level operations including programmatic flow control based on
evaluation of strictly type-checked parameters. Macros are capable of conditional
control over compilation based on predetermined criteria, but cannot instantiate
new types, recurse, or perform type evaluation and in effect are limited to pre-
compilation text-substitution and text-inclusion/exclusion. In other words, macros
can control compilation flow based on pre-defined symbols but cannot, unlike
templates, independently instantiate new symbols. Templates are a tool for static
polymorphism (see below) and generic programming.

In addition, templates are a compile time mechanism in C++ which is Turing-


complete, meaning that any computation expressible by a computer program can
be computed, in some form, by a template metaprogram prior to runtime.

In summary, a template is a compile-time parameterized function or class written


without knowledge of the specific arguments used to instantiate it. After
instantiation the resulting code is equivalent to code written specifically for the
passed arguments. In this manner, templates provide a way to decouple generic,
broadly-applicable aspects of functions and classes (encoded in templates) from
specific aspects (encoded in template parameters) without sacrificing
performance due to abstraction.

Objects

C++ introduces object-oriented (OO) features to C. It offers classes, which


provide the four features commonly present in OO (and some non-OO)
languages: abstraction, encapsulation, inheritance, and polymorphism. Objects
are instances of classes created at runtime. The class can be thought of as a
template from which many different individual objects may be generated as a
program runs.
Encapsulation

Encapsulation is the hiding of information. C++ implements encapsulation by


allowing all members of a class to be declared as either public, private, or
protected. A public member of the class is accessible to any function. A private
member is accessible only to functions that are members of that class and to
functions and classes explicitly granted access permission by the class
("friends"). A protected member is accessible to members of classes that inherit
from the class in addition to the class itself and any friends.

The OO principle is that all of the functions (and only the functions) that access
the internal representation of a type should be encapsulated within the type
definition. C++ supports this (via member functions and friend functions), but
does not enforce it: the programmer can declare parts or all of the representation
of a type to be public, and is allowed to make public entities that are not part of
the representation of the type. Because of this, C++ supports not just OO
programming, but other weaker decomposition paradigms, like modular
programming.

It is generally considered good practice to make all data private or protected, and
to make public only those functions that are part of a minimal interface for users
of the class. This hides all the details of data implementation, allowing the
designer to later fundamentally change the implementation without changing the
interface in any way.

Inheritance

Inheritance allows one data type to acquire properties of other data types.
Inheritance from a base class may be declared as public, protected, or private.
This access specifier determines whether unrelated and derived classes can
access the inherited public and protected members of the base class. Only public
inheritance corresponds to what is usually meant by "inheritance". The other two
forms are much less frequently used. If the access specifier is omitted, a "class"
inherits privately, while a "struct" inherits publicly. Base classes may be declared
as virtual; this is called virtual inheritance. Virtual inheritance ensures that only
one instance of a base class exists in the inheritance graph, avoiding some of the
ambiguity problems of multiple inheritance.

Multiple inheritance is a C++ feature sometimes considered controversial.


Multiple inheritance allows a class to be derived from more than one base class;
this can result in a complicated graph of inheritance relationships. For example, a
"Flying Cat" class can inherit from both "Cat" and "Flying Mammal". Some other
languages, such as Java or C#, accomplish something similar (although more
limited) by allowing inheritance of multiple interfaces while restricting the number
of base classes to one (interfaces, unlike classes, provide only declarations of
member functions, no implementation or member data).

Polymorphism

Polymorphism enables one common interface for many implementations, and for
objects to act differently under different circumstances.

C++ supports several kinds of static (compile-time) and dynamic (run-time)


polymorphisms. Compile-time polymorphism does not allow for certain run-time
decisions, while run-time polymorphism typically incurs a performance penalty.

Static polymorphism

Function overloading allows programs to declare multiple functions having the


same name (but with different arguments). The functions are distinguished by the
number and/or types of their formal parameters. Thus, the same function name
can refer to different functions depending on the context in which it is used. The
type returned by the function is not used to distinguish overloaded functions.

When declaring a function, a programmer can specify default arguments for one
or more parameters. Doing so allows the parameters with defaults to optionally
be omitted when the function is called, in which case the default arguments will
be used. When a function is called with fewer arguments than there are declared
parameters, explicit arguments are matched to parameters in left-to-right order,
with any unmatched parameters at the end of the parameter list being assigned
their default arguments. In many cases, specifying default arguments in a single
function declaration is preferable to providing overloaded function definitions with
different numbers of parameters.

Templates in C++ provide a sophisticated mechanism for writing generic,


polymorphic code. In particular, through the Curiously Recurring Template
Pattern it's possible to implement a form of static polymorphism that closely
mimics the syntax for overriding virtual functions. Since C++ templates are type-
aware and Turing-complete they can also be used to let the compiler resolve
recursive conditionals and generate substantial programs through template
metaprogramming.
INTRODUCTION TO C

In computing, C is a general-purpose computer programming language originally


developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use
with the Unix operating system.[2]

C is block structured, and designed for procedural and imperative programming.


Although C was designed for implementing system software,[3] it is also widely
used for developing application software.

It is widely used on a great many different software platforms and computer


architectures, and several popular compilers exist. C has greatly influenced many
other popular programming languages, most notably C++, which originally began
as an extension to C.
C is an imperative (procedural) systems implementation language. It was
designed to be compiled using a relatively straightforward compiler, to provide
low-level access to memory, to provide language constructs that map efficiently
to machine instructions, and to require minimal runtime support. C was therefore
useful for many applications that had formerly been coded in assembly language.

Despite its low-level capabilities, the language was designed to encourage


machine-independent programming. A standards-compliant and portably written
C program can be compiled for a very wide variety of computer platforms and
operating systems with little or no change to its source code. The language has
become available on a very wide range of platforms, from embedded
microcontrollers to supercomputers.
Characteristics

Like most imperative languages in the ALGOL tradition, C has facilities for
structured programming and allows lexical variable scope and recursion, while a
static type system prevents many unintended operations. In C, all executable
code is contained within functions. Function parameters are always passed by
value. Pass-by-reference is achieved in C by explicitly passing pointer values.
Heterogeneous aggregate data types (struct) allow related data elements to be
combined and manipulated as a unit. C program source text is free-format, using
the semicolon as a statement terminator (not a delimiter).
C also exhibits the following more specific characteristics:

* non-nestable function definitions, although variables may be hidden in nested


blocks
* no abstract character type; characters are represented by their integer
encodings; type char is a kind of integer
* partially weak typing; for instance, characters can be used as integers
* low-level access to computer memory by converting machine addresses to
typed pointers
* function pointers allowing for a rudimentary form of control flow indirection
which can serve as the dispatch mechanism supporting ad hoc runtime
polymorphism
* array indexing as a secondary notion, defined in terms of pointer arithmetic
* a preprocessor for macro definition, source code file inclusion, and
conditional compilation
* complex functionality such as I/O, string manipulation, and mathematical
functions consistently delegated to library routines
* a few dozen reserved keywords
* syntax divergent from ALGOL, often following the lead of C's predecessor B,
for example using
o { ... } rather than ALGOL's begin ... end
o the equal-sign for assignment (copying), much like Fortran
o two consecutive equal-signs to test for equality (compare to .EQ. in
Fortran or the equal-sign in BASIC)
o && and || in place of ALGOL's and and or, which
+ are syntactically distinct from the bit-wise operators & and | (used by
B for both meanings)
+ never evaluate the right operand if the result can be determined from
the left alone (short-circuit evaluation)
o a large number of compound operators, such as +=, ++, ......
Operators in C and C++

This is a list of operators in the C++ and C programming languages. All the
operators listed exist in C++; the third column indicates whether an operator is
also present in C. It should also be noted that C does not support operator
overloading.

The following operators are sequence points in both languages (when not
overloaded): &&, ||, ?:, and , (the comma operator).

C++ also contains the type conversion operators const_cast, static_cast,


dynamic_cast, and reinterpret_cast which are not listed in the table for brevity.
The formatting of these operators means that their precedence level is
unimportant.

Those operators that are in C, with the exception of the comma operator and the
arrow operator, are also in Java, Perl, C#, and PHP with the same precedence,
associativity, and semantics, with one exception: ternary operator associativity in
PHP is left-to-right.
Arithmetic operators
Operator Name Syntax Overloadable Included in C
Unary Plus +a Yes Yes
Addition (Sum) a + b Yes Yes
Prefix Increment ++a Yes Yes
Postfix Increment a++ Yes Yes
Assignment by Addition a += b Yes Yes
Unary Minus (Negation) -a Yes Yes
Subtraction (Difference) a - b Yes Yes
Prefix Decrement --a Yes Yes
Postfix Decrement a-- Yes Yes
Assignment by Subtraction a -= b Yes Yes
Multiplication (Product) a * b Yes Yes
Assignment by Multiplication a *= b Yes Yes
Division (Quotient) a / b Yes Yes
Assignment by Division a /= b Yes Yes
Modulus (Remainder) a % b Yes Yes
Assignment by Modulus a %= b Yes Yes

Comparison operators
Operator Name Syntax Overloadable Included in C
Less Than a < b Yes Yes
Less Than or Equal To a <= b Yes Yes
Greater Than a > b Yes Yes
Greater Than or Equal To a >= b Yes Yes
Not Equal To a != b Yes Yes
Equal To a == b Yes Yes

Logical operators
Operator Name Syntax Overloadable Included in C
Logical Negation !a Yes Yes
Logical AND a && b Yes Yes
Logical OR a || b Yes Yes

Bitwise operators
Operator Name Syntax Overloadable Included in C
Bitwise Left Shift a << b Yes Yes
Assignment by Bitwise Left Shift a <<= b Yes Yes
Bitwise Right Shift a >> b Yes Yes
Assignment by Bitwise Right Shift a >>= b Yes Yes
Bitwise One's Complement ~a Yes Yes
Bitwise AND a & b Yes Yes
Assignment by Bitwise AND a &= b Yes Yes
Bitwise OR a | b Yes Yes
Assignment by Bitwise OR a |= b Yes Yes
Bitwise XOR a ^ b Yes Yes
Assignment by Bitwise XOR a ^= b Yes Yes

Other operators
Operator Name Syntax Overloadable Included in C
Basic Assignment a = b Yes Yes
Function, Call a() Yes Yes
Array Subscript a[b] Yes Yes
Indirection (Dereference) *a Yes Yes
Address-of (Reference) &a Yes Yes
Member by Pointer a->b Yes Yes
Member a.b No Yes
Member by Pointer Function Pointer Indirection a->*b Yes No
Member Function Pointer Indirection a.*b No No
Cast (type) a Yes Yes
Comma a , b Yes Yes
Ternary Conditional a ? b : c No Yes
Scope Resolution a::b No No
Member Function Pointer a::*b No No
sizeof a
Size-of sizeof(type) No Yes
typeid(a)
Type Identification typeid(type) No No
Allocate Storage new type Yes No
Allocate Storage (Array) new type[n] Yes No
Deallocate Storage delete a Yes No
Deallocate Storage (Array) delete[] a Yes No
OPERATOR PRECEDENCE

The following is a table that lists the precedence and associativity of all the
operators in the C++ and C programming languages (when the
operators also exist in Java, Perl, PHP and many other recent
languages the precedence is the same as that given). Operators are
listed top to bottom in descending precedence and operators that
are in the same cell (there may be several rows of operators listed in
a cell) are evaluated with the same precedence, in the given
direction. An operator's precedence is unaffected by overloading.

The syntax of expressions in C and C++ is specified by a context-free


grammar. The table given here has been inferred from the grammar.

A precedence table, while mostly adequate, cannot resolve a few details. In


particular, note that the ternary operator allows any arbitrary
expression as its middle operand, despite being listed as having
higher precedence than the assignment and comma operators. Thus
a ? b , c : d is interpreted as a ? (b, c) : d, and not as the meaningless
(a ? b), (c : d). Also, note that the immediate, unparenthesized result
of a C cast expression cannot be the operand of sizeof. Therefore,
sizeof (int) * x is interpreted as (sizeof(int)) * x and not sizeof ((int)
*x).

Operator Description Associativity


:: Scope resolution (C++ only) Left-to-Right
++ -- Postfix increment and decrement
() Function call
[] Array subscripting
. Element selection by reference
-> Element selection through pointer
Run-time type information (C++ only)
typeid()

const_cast Type cast (C++ only)


dynamic_cast Type cast (C++ only)
reinterpret_cast Type cast (C++ only)
static_cast
Type cast (C++ only)
++ -- Prefix increment and decrement Right-to-Left
+- Unary plus and minus
!~ Logical NOT and bitwise NOT
(type) Type cast
* Indirection (dereference)
& Address-of (reference)
sizeof Size-of
new new[] Dynamic memory allocation (C++ only)
delete delete[] Dynamic memory deallocation (C++ only)
.* ->* Pointer to member (C++ only) Left-to-Right
*/% Multiplication, division, and modulus (remainder)
+- Addition and subtraction
<< >> Bitwise left shift and right shift
< <= Relational “less than” and “less than or equal to”
> >= Relational “greater than” and “greater than or equal to”
== != Relational “equal to” and “not equal to”
& Bitwise AND
^ Bitwise XOR (exclusive or)
| Bitwise OR (inclusive or)
&& Logical AND
|| Logical OR
c?t:f Ternary conditional (see ?:) Right-to-Left
= Direct assignment (provided by default for C++ classes) (Not available for throw)
+= -= Assignment by sum and difference
*= /= %= Assignment by product, dividend, and remainder
<<= >>= Assignment by bitwise left shift and right shift
&= ^= |= Assignment by bitwise AND, XOR, and OR
throw Throw operator (exceptions throwing, C++ only)
, Comma Left-to-Right

Anda mungkin juga menyukai