Programming Fundamentals Lab 01 (Understanding and Installation of IDE)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Programming Fundamentals

Lab Manual 1

Topic: What is IDE, Downloading and Installation of IDE and


First C++ Project(Program)

Lab Instructor: Ahmad Abduhu

Session: Fall 2018

School of Systems and Technology


UMT Lahore Pakistan
Contents
Integrated Development Environment (IDE)...............................................................................................................3
What does Integrated Development Environment (IDE) mean?.............................................................................3
Code::Blocks................................................................................................................................................................4
Downloading and Installation of Code::Blocks............................................................................................................4
Step 1: Download the IDE.......................................................................................................................................4
Step 2: Installing the IDE.........................................................................................................................................4
First Project................................................................................................................................................................. 7
Integrated Development Environment (IDE)
What does Integrated Development Environment (IDE) mean?
An integrated development environment (IDE) is a software application that provides comprehensive
facilities to computer programmers for software development. An IDE normally consists of a source
code editor, build automation tools, and a debugger. Most modern IDEs have intelligent code
completion.
IDEs offer a central interface featuring all the tools a developer needs, including the following:

 Code editor: This feature is a text editor designed for writing and editing source code. Source
code editors are distinguished from text editors because they enhance or simplify the writing
and editing of code.
 Compiler: This tool transforms source code written in a human readable/writable language into
a form executable by a computer.
 Debugger: This tool is used during testing to help debug application programs.
 Build automation tools: These tools automate common developer tasks.
 
In addition, some IDEs might also include the following:
 
 Class browser: This tool is used to examine and reference the properties of an object-oriented
class hierarchy.
 Object browser: This feature is used to examine the objects instantiated in a running application
program.
 Class hierarchy diagram: This tool allows the programmer to visualize the structure of object-
oriented programming code.
Code::Blocks
Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is
designed to be very extensible and fully configurable

Downloading and Installation of Code::Blocks


Step 1: Download the IDE
In order to install the Code::Blocks IDE as well as the MinGW compiler, you must download it. You can
download it for Windows from here:

https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw-
setup.exe/download

Save the file to your hard disk and remember its location. Proceed to the next page in order to continue
the installation. If you are using Mac OS X or Linux, please see Appendix I for installation instructions.

Step 2: Installing the IDE


Next, open (click on) CodeBlocks install file and the CodeBlocks Setup will begin installing as follows:
Click Next.
Select I Agree.
Take the default settings by pressing Next.

Take the default folder to install CodeBlocks to and then select Install.
First Project
After you have finished downloading and setting up the Code::Blocks system, you can be in to write
code. Code::Blocks creates what is called a Workspace to keep track of the project you are working
on. It is possible for you to be working on multiple projects within your workspace. A project is a
collection of one or more source (as well as header) files. Source files are the files that contain the
source code for your program. If you are developing a C++ program, you are writing C++ source code
(.cpp files).
Header files are used when you are creating library files (.h files). A library is a collection of
functions that are called to perform specific tasks, such as doing math, etc.

Setting up a project allows you to keep track of all the files in an organized way. When first starting
out in computer programming, generally your projects will consist of a single source file. However as
you gain experience and work on more complex projects, you will have projects containing many
source files and dealing with header files as well.
To create a project, click on the File pull-down menu, open New and then Project.
This will bring up the New from template window. Opening (clicking on) Console Application will
then allow you to write a program on the console. The other application are for developing more
advanced types of applications. After selecting Console application, click on the Go button to begin
using the Console Application Wizard.
Press Next to llgo to the next step.
The next window allows you to choose the language that you will use. Select the language as C++, then
press Finish.
Start by filling in the Project Title. You will notice that the Project Filename automatically becomes the
same name. If you wish, you can change the filename, but for simplicity leave it as is. To specify the
location of the folder to contain the project, click on the “...” button (selected in the picture above) and
browse to a folder on your drive to store the project. Generally, you can save it in My Documents.
Press Ok after selecting My Documents

When the directory for your project has been selected, the system will return to the Console
application. As shown, Code Blocks will create a directory called First Program (Project Title) and
returns your selected directory in Folder to create project in. Inside that directory will be the Project
filename (First Program) and a resulting filename, which contains a Code Block Project file (.cbp)
named First Program.cbp. The project title and project filename in this case are the same. However,
they need not be the same and these names can be altered. Click on the Next Button when done.
The next window to pop up will be the Compiler screen. This specifies where the Debug and Release
compiled versions of your program will be placed. Leave this setting alone and press Next.
The system will then return to the [First Program] window and you are ready to write your
program. It should be noted that the Build target is Debug, which will allow you to use the
debugger to find errors. In the Management area of the screen (Shift-F2 toggles the
Management display), you will see the files that are part of the project in the Projects tab. To
see the source files, click on the plus [+]’s to expand the Workspace and its subdirectories.
Under Sources, there is a file called main.cpp, which is automatically created for you when
you build a console application.

You might also like