Assignment 2: Write a program in (Eclipse) C++ to display string “Hello World”.

Aim: Write a program in (Eclipse) C++ to display string “Hello World”. 

Theory:
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.
1. Classes and objects. A class is similar to a C structure, except that the definition of the data structure, and all of the functions that operate on the data structure are grouped together in one place. An object is an instance of a class (an instance of the data structure); objects share the same functions with other objects of the same class, but each object (each instance) has its own copy of the data structure. A class thus defines two aspects of the objects: the data they contain, and the behavior they have.
2. Member functions. These are functions which are considered part of the object and are declared in the class definition. They are often referred to as methods of the class. In addition to member functions, a class's behaviour is also defined by:
  1. What to do when you create a new object (the constructor for that object) - in other words, initialize the object's data.
  2. What to do when you delete an object (the destructor for that object).

3. Private vs. public members. A public member of a class is one that can be read or written by anybody, in the case of a data member, or called by anybody, in the case of a member function. A private member can only be read, written, or called by a member function of that class.

Classes are used for two main reasons: (1) it makes it much easier to organize your programs if you can group together data with the functions that manipulate that data, and (2) the use of private members makes it possible to do information hiding, so that you can be more confident about the way information flows in your programs.

1. What is Eclipse?
Most people know Eclipse as an integrated development environment (IDE) for Java. Today it is the leading development environment for Java with a market share of approximately 65%.
Eclipse is created by an Open Source community and is used in several different areas, e.g. as a development environment for Java or Android applications. The roots of Eclipse go back to 2001.
The Eclipse Open Source community has over 200 Open Source projects covering different aspects of software development.
The Eclipse IDE can be extended with additional software components. Eclipse calls these software components plug-ins. Several Open Source projects and companies have extended the Eclipse IDE or created standalone applications (Eclipse RCP) on top of the Eclipse framework.

2. Eclipse Foundation
The Eclipse projects are governed by the Eclipse Foundation. The Eclipse Foundation is a non-profit, member supported corporation that hosts the Eclipse Open Source projects and helps to cultivate both an Open Source community and an ecosystem of complementary products and services.


Flowchart for Hello World


Program:

#include<iostream>
using namespace std;
int main()
{
cout<<”hello world:”;
return 0;
}

Output:
hello world:

Conclusion: Hence the program is implemented.

0 comments:

Post a Comment