43
Submitted By, B.Gireesam Roll: 0520 No. : 20017 Netaji Vidyapith Rly H.S Schol

gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

Submitted By,B.GireesamRoll: 0520 No. : 20017Netaji Vidyapith Rly H.S Schol

ACKNOWLEDGEMENT

Page 2: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

I thank the staff of the Computer Science department and laboratories for the help and guidance provided to me during this investigatory project. I also thank the school Principal for permitting the use of the lab and other resources of the school required for completing the project.

Name of the Candidate: B.Gireesam

Roll Number: 0520- 200217

Registration No. : 128259Date: 24-03-14

Netaji Vidyapith Rly H.S School

Page 3: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

DEPARTMENT OF COMPUTER SCIENCE

NETAJI VIDYAPITH RLY. H.S SCHOOL

BONAFIDE CERTIFICATE

This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate ____B.Gireesam____ with roll number __0520-20017_ for the class XII practical examination of the Assam Higher Secondary Education Council in the year 2014.It is further certified that this project is the individual work of the candidate.

Signature: Date:

INDEX

Page 4: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

1) Introduction to Interneta) Networking Conceptb) OSI Layering Model

2) Introduction to Program methodologya) Flowchartb) Two examples of flowchart

3) Introduction to C language

4) Introduction to C++ language a) Concept of class object b) Member Function

5) Two C++ Programs

Page 5: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

1. INTRODUCTION TO INTERNET

Introduction:By the turn of the century, information, including access to the Internet, will be the basis for personal, economic, and political advancement. The popular name for the Internet is the information superhighway. Whether you want to find the latest financial news, browse through library catalogs, exchange information with colleagues, or join in a lively political debate, the Internet is the tool that will take you beyond telephones, faxes, and isolated computers to a burgeoning networked information frontier. The Internet supplements the traditional tools you use to gather information, Data Graphics, News and correspond with other people. Used skillfully, the Internet shrinks the world and brings information, expertise, and knowledge on nearly every subject imaginable straight to your computer.

What is the Internet?

The Internet links are computer networks all over the world so that users can share resources and communicate with each other. Some computers, have direct access to all the facilities on the Internet such as the universities. And other computers, eg privately-owned ones, have indirect links through a commercial service provider, who offers some or all of the Internet facilities. In order to be connected to Internet, you must go through

Page 6: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

service suppliers. Many options are offered with monthly rates. Depending on the option chosen, access time may vary.The Internet is what we call a metanetwork, that is, a network of networks that spans the globe. It's impossible to give an exact count of the number of networks or users that comprise the Internet, but it is easily in the thousands and millions respectively. The Internet employs a set of standardized protocols which allow for the sharing of resources among different kinds of computers that communicate with each other on the network. These standards, sometimes referred to as the Internet Protocol Suite, are the rules that developers adhere to when creating new functions for the Internet. The Internet is also what we call a distributed system; there is no central archives. Technically, no one runs the Internet. Rather, the Internet is made up of thousands of smaller networks. The Internet thrives and develops as its many users find new ways to create, display and retrieve the information that constitutes the Internet.

History & Development of the Internet:

In its infancy, the Internet was originally conceived by the Department of Defense as a way to protect government communications systems in the event of a military strike. The original network, dubbed ARPANet (for the Advanced Research Projects Agency that developed it) evolved into a communications channel among contractors, military personnel, and university researchers who were contributing to ARPA projects. The network employed a set of standard protocols to create an effective way for these people to communicate and share data with each other. ARPAnet's popularity continued to spread among researchers, and in the 1980's the National Science Foundation, whose NSFNet, linked several high speed computers, took charge of the what had come to be known as the Internet. By the late 1980's, thousands of cooperating networks were participating in the Internet. In 1991, the U.S. High Performance Computing Act established the NREN (National Research & Education Network). NREN's goal was to develop and maintain high-speed networks for research and education, and to investigate commercial uses for the Internet.

Page 7: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

The rest, as they say, is history in the making. The Internet has been improved through the developments of such services as Gopher and the World Wide Web. Even though the Internet is predominantly thought of as a research oriented network, it continues to grow as an informational, creative, and commercial resource every day and all over the world.

NETWORKING CONCEPT

What Is a Computer Network?

In the broadest sense, a network is any interconnected group of people or things capable of sharing meaningful information with one another. In a technology context, network is usually short for "computer network" or "data network" and implies that computers are the things sharing the meaningful information. At a conceptual level, all data networks consist of nodes, which refers to any computer or digital device using the network and links, the physical connections (either wired or wireless) that carry messages between nodes.

Data networks are important to all contemporary organizations because they provide faster, easier access to any message or data that can be represented and stored in digital format. For example, when your colleagues and predecessors research an issue relevant to your organization and share their data and conclusions with you in a data format your computer recognizes, you can copy key information from their report into your own, saving yourself significant amounts of time (of course, you're always sure to give credit where it's due). If the colleague whose work you're relying on works in the same cubicle as you and they remember where they've stored the relevant report, a network may not offer significant advantages since you can turn to him or he and ask for the file on a CD or USB flash drive. However, in many organizations, large distances separate co-workers, and data sharing becomes a significant logistical problem in the absence of a network.

In addition to data sharing, computer networks also enable resource sharing, an important consideration in all budget-conscious charities and organizations. Rather than buying one printer for every employee and replacing them when they wear out, an organization with a network can buy a single printer, connect it to the

Page 8: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

network, and configure it in such a way that every computer user in the organization can print to it. The initial cost of a networked printer is usually more than the cost of a single desktop printer, but when considering costs on a per-user basis, the average cost of the networked printer is often much less than the cost of buying a printer for every employee. While some networked devices such as printers, scanners, and fax machines have predetermined, specialized functions, you can also network and share generic, unspecialized computing power in the form of servers. Servers are large, powerful computers that can handle resource-intensive tasks more efficiently than desktop computers. As with the networked printer, the initial outlay for a server is more than that for a desktop computer, but across the organization, it's often cheaper to run the server-based version of a program since individual users won't need expensive, high-performance desktop and laptop computers. Servers can also deploy software to other networked machines at a lower cost.

Roles and Responsibilities:

Networks also vary considerably in terms of the roles and responsibilities of the computers on that network and the relationships that tie those machines together. A computer totally disconnected from other devices is typically referred to as a standalone machine.

When several computers are interconnected, but no computer occupies a privileged position, the network is usually referred to as a peer-to-peer network. In this type of network, every computer can communicate with all the other machines on the network, but in general each one stores its own files and runs its own applications.

With a client-server network, one or more servers will perform critical functions on behalf of the other machines (the clients) on the network. These functions might include user authentication, data storage, and the running of large, shared, resource-intensive applications such as databases and client relationship management (CRM) software. Typically, both peer-to-peer and client-server networks rely on a shared Internet connection for access to external resources of these basic network structures.

Another type of network that's been rapidly gaining in popularity over the past decade is the cloud-based network. In this model, an organization pays a third-party vendor to host data, applications and other resources on servers and manages those resources via a web browser. A cloud-dependent network can be

Page 9: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

simpler, cheaper, and greener than a client-server network since you aren't buying, maintaining and powering your own servers. However, it's not necessarily the right solution for every organization – particularly those that handle and store sensitive client data or health records. Learn more about cloud computing for your nonprofit or library on TechSoup's cloud page.

Standards and Protocols:

Protocols, also known as standards, are essential parts of many modern technologies. In essence, they're consensus-based documents that describe guidelines for vendors, manufacturers, and other stakeholders in order to ensure quality and interoperability in a diverse, competitive marketplace. Most networking protocols are fairly obscure and you only need to worry about them if something goes wrong. However a few standards are so widely adopted that every decision-maker and accidental techie needs to know their names and basic functions. Discussing networking without implicit or explicit reference to Ethernet and TCP/IP protocols is like discussing American law and politics without reference to the Constitution and the Bill of Rights.

Furthermore, adopting widely-accepted protocols (also known as de facto standards) has benefits in all aspects of technology, since it's a form of future-proofing. When you need to repair, replace, or upgrade networking equipment years from now, you can safely predict that products and services compatible with today's widely-adopted standards will still be available. Therefore, you can replace a few pieces of outdated equipment without building a new network from scratch. Also, you'll be able to find technicians and consultants who still understand these protocols.

After several decades of struggle amongst competing network protocols (each with a different corporate sponsor), three sets of network protocols emerged as de facto standards for local networks by the late 1990s. In local area networks, Ethernet over twisted pair (also known as 10 BASE T, twisted-pair Ethernet, or IEEE 802.3) is the accepted standard for wired networking while 802.11b/g/n (or WiFi) is the accepted standard for wireless networks. The TCP/IP protocol stack is a standard component of almost all modern networks, especially when those networks expect to communicate on the Internet where TCP/IP is the lingua franca. In wide area networking, there still exists a large degree of diversity and competition among networking protocols. However, at the local network level, any networking technology your organization adopts should be compatible with the three standards mentioned above.

Page 10: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

Further Resources:

Cisco provides a number of educational resources about networking online and in print that range from basic to advanced. For a fairly gentle overview of basic networking topics, read Networking Basics on Cisco's site or Cisco Networking Simplified. Lantronix's Ethernet Tutorial is another good introduction-level overview of networking.

For a more in-depth discussion of network design and related topics, check out Cisco's Internetwork Design Guide. CompTIA Network 2009 In Depth and other exam prep guides for the Network+ certification also offer thorough yet readable coverage of fundamental networking topics.

Conclusion:

Networking offers a variety of advantages for many nonprofits, charities, and libraries over standalone machines, but they're not necessarily needed for every office or work scenario.

ISO-OSI LAYERING MODEL INTRODUCTION: In an effort to provide some standard to the way networking should work, a model was developed by the International Standards Organisation (ISO). This is a theoretical layered model in which the notation of networking is devided into several layers, each of which has specific functions and features. The model is known as the Open Systems Interconnect (OSI) model & represents only a general guideline for developing usable network interfaces and protocols.

Page 11: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

THE Description Of The 7 Layers:

Page 12: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

Summary:The most identified benefit of the OSI model is that it organizes thinking about networks and give novices,journeymen, and masters a common, computer networking language. Human communication, discussions, andcollaboration can use this language to remove ambiguity and clarify intent.

2. INTRODUCTION TO PROGRAMMING METHODOLOGY:

Programming methodology is a process of developing programs that involves strategically dividing important tasks into functions to be utilized by the entirety of the program. It also describes the thinking process that goes into developing a programming solution for a specific problem .

A computer program is a set of instructions written by a programmer to perform some specific task. Any information to be processed requires some specific instructions to execute, which the programmer must supply. The set of instructions together is called a computer program and the persons who writes the instructions are called programmers. A programmer writes the computer programs with the help of a facility called computer language.

FLOWCHART: A flowchart is a type of diagram that represents an algorithm or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows. This diagrammatic representation illustrates a solution to a given problem. Process operations are represented in

Page 13: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

these boxes, and arrows; rather, they are implied by the sequencing of operations. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields.

Flowcharts are used in designing and documenting complex processes or programs. Like other types of diagrams, they help visualize what is going on and thereby help the viewer to understand a process, and perhaps also find flaws, bottlenecks, and other less-obvious features within it. There are many different types of flowcharts, and each type has its own repertoire of boxes and notational conventions.

FLOWCHART SYMBOLS:

Flowchart symbols are traditional. There are different symbols used in flowchart with different shapes to describe different meanings and operations. Through the flowchart symbols do not have any scientific meanings, still they are internationally accepted as tools for logic and program development. The following are the some standard flowchart symbols.

Some commonly used flowchart symbols are as follow :

Page 14: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate
Page 15: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

RULES FOR DRAWING A FLOWCHART :

Flowcharts are the means of communication between person to person instead of being person to computer. No standard mathematical formula used to draw flowcharts. It requires some practices to be familiar with it for the beginners.The followings are some of the standard rules for drawing a flowchart.

i) Only those symbols should be used which are traditional.ii) The arrows in the flowchart represent the direction of flow of control and data in the problem.iii) The logic of a program flowchart should flow from top to bottom and from left to right.iv) Normally flow lines should not cross each other.v) Each symbol (except decision box) used in a program flowchart should have one entry and one exit point.vi) As far as possible, the statement within the symbols of a program flowchart should be independent of any programming language.

LOGICAL CONSTRUCT IN FLOWCHART:

Flowchart may be very simple or very complexdepending on the type of problems. No matter, how simple or complex it is. All the flowchartscan be categorized in three logical construct.

1. Sequential Logic :- As the name implies, sequential logic simply describe the flow of control from top to bottom without any branching or iteration.

Page 16: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

2. Selective Logic :- Selective logic is always concerned with one out of two or more alternatives.3. Iterative Logic :- Iterative logic or looping involves repetition of same job. It reduces the number of same statements from the solution of a problem.

EXAMPLES OF FLOWCHART Example 1: Draw a flowchart to add even number.

Page 17: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

Example 2: Draw a flowchart to find (a+b) 2

Page 18: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

3. INTRODUCTION TO C LANGUAGE

In computing, C is a general-purpose programming language initially developed by Dennis Ritchie of USA in 1972 at AT &T Bell Labs. Ritchie is also called father of C language.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. Its design provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, most notably system software like the Unix computer operating system.

C is also called a general purpose programming language. A typical C program is made of several functions which may be contained in one or more source files called C Library.Every C- program must have a function named main where the program execution always begin. Each source file is compiled separately, and then all are linked together to form a execuitable program. C compiler combines the capability of both assembly language and high level language and therefore it is used for writing system programs and business programs. Interestingly many of the compilers are written in C.

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 subroutines, which are called "functions" (although not in the strict sense of functional programming). Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements.

The C language also exhibits the following characteristics:

Page 19: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

There is a small, fixed number of keywords, including a full set of flow of control primitives: for, if/else, while, switch, and do/while. There is one namespace, and user-defined names are not distinguished from keywords by any kind of sigil.

There are a large number of arithmetical and logical operators, such as +, +=, ++, &, ~, etc.

More than one assignment may be performed in a single statement. Function return values can be ignored when not needed. Typing is static, but weakly enforced: all data has a type, but implicit conversions can be

performed; for instance, characters can be used as integers. Declaration syntax mimics usage context. C has no "define" keyword; instead, a

statement beginning with the name of a type is taken as a declaration. There is no "function" keyword; instead, a function is indicated by the parentheses of an argument list.

User-defined (typedef) and compound types are possible. Heterogeneous aggregate data types (struct) allow related data elements to be accessed

and assigned as a unit. Array indexing is a secondary notion, defined in terms of pointer arithmetic. Unlike

structs, arrays are not first-class objects; they cannot be assigned or compared using single built-in operators. There is no "array" keyword, in use or definition; instead, square brackets indicate arrays syntactically, e.g. month[11].

Enumerated types are possible with the enum keyword. They are not tagged, and are freely interconvertible with integers.

Strings are not a separate data type, but are conventionally implemented as null-terminated arrays of characters.

Low-level access to computer memory is possible by converting machine addresses to typed pointers.

Procedures (subroutines not returning values) are a special case of function, with an untyped return type void.

Functions may not be defined within the lexical scope of other functions. Function and data pointers permit ad hoc run-time polymorphism. A preprocessor performs macro definition, source code file inclusion, and conditional

compilation. There is a basic form of modularity: files can be compiled separately and linked

together, with control over which functions and data objects are visible to other files via static and extern attributes.

Complex functionality such as I/O, string manipulation, and mathematical functions are consistently delegated to library routines.

Page 20: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

Basic Structure Of A C Program:

Page 21: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

For Example:

Write a C program to add two numbers using function (By Pass value method)

4. INTRODUCTION TO C++ LANGUAGE

Page 22: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

C++ provides a collection of predefined classes, along with the capability of user-defined classes. The classes of C++ are data types,which can be instantiated any number of times. Class definitions specify data objects (called data members) and functions (called member function). Classes can name one or more parent classes, providing inheritance and multiple inheritance, respectively. Classes inherit the data members and member functions of the parent class that are specified to be inheritable. Therefore it is mainly used for:

Software Engineering Graphics

A Brief History of C++

     In the early 1970s, Dennis Ritchie of Bell Laboratories was engaged in a project to develop a new operating system.  Ritchie discovered that in order to accomplish his task he needed the use of a programming language that was concise and that produced compact and speedy programs. This need led Ritchie to develop the programming language called C.

     In the early 1980's, also at Bell Laboratories, another programming language was created which was based upon the C language.  This new language was developed by Bjarne Stroustrupand was called C++.  Stroustrup states that the purpose of C++ is to make writing good programs easier and more pleasant for the individual programmer.  When he designed C++, he added OOP (Object Oriented Programming) features to C without significantly changing the C component.  Thus C++ is a "relative" (called a superset) of C, meaning that any valid C program is also a valid C++ program.

     There are several versions of the C++ language, of which Visual C++ is only one.  Other dialects include Borland C++, Turbo C++, and Code Warrior (Mac).  All of these software packages enable you to create computer programs with C++, but they all implement the C++ language in a slightly different manner.  In an attempt to maintain portability of both the C and C++ languages, the American National Standards Institute (ANSI) developed a standard of consistency for C and C++ programming.  While we will be working primarily with this ANSI standard, we will also be examining the idiosyncrasies of Microsoft Visual C++ 6.0.

CONCEPT OF CLASS AND OBJECT

INTRODUCTION :

Page 23: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

The real world entities are called objects,which are derived from some classes.An object may be physical or logical.For example an wooden table is a physical object with several attributies or properties such as number of legs ,color ,weight ,hight etc.derived from class wood.But proper classification of class and object iis littlebit confusing.Because,one may say that woods are object derived from class tree ,where another one may say that different trees are object derived from class forest and so on.A class is a set of members or properties.The members of a class doesnot have ny value,but they are capable of holding values or data .For eexample if a man is a class,then properties such as name,address,sex age doesnot have any particular value.but when the objects are created from the class man such as Hari,jadu,madghu etc.then each object wil contain some attributes value.For example name is Hari,address is Guwahati.,sex is male,age is 32. Attributes values for each and every objects may be different or same.The number of attributes of each object are same.

CLASS DEFINITION :

A class is defined with the keywords class.The class is a powerful keyword in C++.The general form of a class definition is

Class <class name>

{

<access specifier> :

data members ;

member functions;

} ;

Example 1: Example 2:

Page 24: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

class student

{

private :

int rollno;

char name[20];

float fees ;

public:

void get data ();

void disp();

};

Access Specifier :

A access specifier are keywords that may restricts the acccess of data from some places within a program.In c++ ,there are three access specifiers.

(a) Private(b) Protected(c) Publlic

(a) Private : Data members or member functions which are declared as private,can access only member function of that class.Private members are not accessable fom outside the class definitation.The class is called data hiding in C++.Data is there ,but can not be accessed.In C++ data hiding Can not be enforced by making a private pprivate.

(b)Protected : Protected members are similar to private members except they allow data to inherited ffrom its child class .Protected members are not accessable from outside the class definition.

class customer

{

private:

int accno;

char name[20];

void read accno();

public:

float balance;

void deposit();

void withdraw();

} ;

Page 25: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

(c) Public : Public members cannot be accessed from outside the cclass also.It violates the

data hiding property.

MEMBER FUNCTIONS A member function of a class is a function that has its definition or its prototype within the class definition like any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a class for that object.

Member functions can be defined within the class definition or separately using scope resolution operator, ::. Defining a member function within the class definition declares the function inline, even if you do not use the inline specifier. So either you can define Volume() function as below:

class Box

{

public:

double length; // Length of a box

double breadth; // Breadth of a box

double height; // Height of a box

double getVolume(void)

{

return length * breadth * height;

}

};

If you like you can define same function outside the class using scope resolution operator, :: as follows:

double Box::getVolume(void)

Page 26: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

{

return length * breadth * height;

}

Here, only important point is that you would have to use class name just before :: operator. A member function will be called using a dot operator (.) on a object where it will manipulate data related to that object only as follows:

Box myBox; // Create an object

myBox.getVolume(); // Call member function for the object

Let us put above concepts to set and get the value of different class members in a class:

#include <iostream>

using namespace std;

class Box

{

public:

double length; // Length of a box

double breadth; // Breadth of a box

double height; // Height of a box

// Member functions declaration

double getVolume(void);

void setLength( double len );

void setBreadth( double bre );

void setHeight( double hei );

Page 27: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

};

// Member functions definitions

double Box::getVolume(void)

{

return length * breadth * height;

}

void Box::setLength( double len )

{

length = len;

}

void Box::setBreadth( double bre )

{

breadth = bre;

}

void Box::setHeight( double hei )

{

height = hei;

}

// Main function for the program

int main( )

{

Box Box1; // Declare Box1 of type Box

Box Box2; // Declare Box2 of type Box

double volume = 0.0; // Store the volume of a box here

Page 28: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

// box 1 specification

Box1.setLength(6.0);

Box1.setBreadth(7.0);

Box1.setHeight(5.0);

// box 2 specification

Box2.setLength(12.0);

Box2.setBreadth(13.0);

Box2.setHeight(10.0);

// volume of box 1

volume = Box1.getVolume();

cout << "Volume of Box1 : " << volume <<endl;

// volume of box 2

volume = Box2.getVolume();

cout << "Volume of Box2 : " << volume <<endl;

return 0;

}

C++ Program for Quiz Show

Page 29: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

SOURCE CODE/*…………… Quiz Test……………*/#include<iostream.h>#include<stdlib.h>#include<string.h>#include<conio.h>#include<fstream.h>

class contest{private:

int roll;float x, grd;char name[20];char s[100], ans;

public:contest(){ x=0; }voidinit();void define();void grade();

};void contest :: define(){

ifstream in;char a;int i=0;in.open(“ques.txt”);while(in.eof()=o){in.getline(s,100);cout<<endl<<s;

if(i=5){in.get(a);cout<<”\nans:”;cin>>ans;i= -2;if(ans==a)

Page 30: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

{x=x+5;cout<<”*Yourans correct.\n”;}Else

L:cout<<”\n\n\tselect your choice:\n”<<”\n\t1 for start exam”<<”\n\t0 for quit the exam:”;int c;cin>>c;

switch(c){case 1:r.define();r.display();r.grade();break;case 0:exit(1);default:cout<<”invalid choice!”;goto L;}getch();

}

OUTPUTFigure 1:- Main Page of the Quiz program Window

Page 31: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

Figure 2:- Result Display

Page 32: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate
Page 33: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

The projects helped me a lotto clear my doubts what-so-everI earlier harboured with regard toMS-WORD, & C-PROGRAMMING.It also helped firsthand knowledge of MS-WORD, & C-PROGRAMMINGwhich was totally a new field for me;but which is a must for every concerned citizen.I must admit that the compliation processOf this project was an wonderful experienceWhich I would preserve all through my life.Before I wind up, I would like to offer My heartfelt gratitude to the AHSEC board For providing the opportuinity

Page 34: gireescreation.files.wordpress.com  · Web view2014. 3. 29. · This is to certify that the Computer Science & Application investigatory project had been submitted by the candidate

To do such meaningful projectsWhich has extended the area of my knowledge.

Computer essentials with MS-Windows 95( Tata McGraw-Hill series)

Computer science and application(Dr. Pranhari Talukder )

The C programming language(Brain W.Kernighan)

Basic for schools(Janet D’souza)

Shiksha(Aptech)

Programming with C++(Ravichandan D)

Digital Tehniques(Talukder PH)