0% found this document useful (0 votes)
99 views6 pages

Installing and Getting Started With Dev C++ IDE

Here are the steps for degree completion: 1. Apply for admission and take an admission test. Student can take admission if marks in test are equal or more than 50%. 2. In the first semester, register courses up to a maximum of 18 credit hours. Courses can only be registered if prerequisites are cleared. 3. Attend classes and write mid-term exams. Student can withdraw a maximum of 2 courses if marks are less than 50% in mid-term. 4. Attend remaining classes and write final exams. 5. Semester ends. Check credits earned and SGPA/CGPA is calculated. 6. If CGPA is less than 2, student
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views6 pages

Installing and Getting Started With Dev C++ IDE

Here are the steps for degree completion: 1. Apply for admission and take an admission test. Student can take admission if marks in test are equal or more than 50%. 2. In the first semester, register courses up to a maximum of 18 credit hours. Courses can only be registered if prerequisites are cleared. 3. Attend classes and write mid-term exams. Student can withdraw a maximum of 2 courses if marks are less than 50% in mid-term. 4. Attend remaining classes and write final exams. 5. Semester ends. Check credits earned and SGPA/CGPA is calculated. 6. If CGPA is less than 2, student
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

LAB 1: C++ Getting Startedhttp://prdownloads.sourceforge.

net/dev-cpp/devcpp-
4.9.9.2_setup.exe.

Installing and getting started with Dev C++ IDE


Download Link: C++ features are:
- Support GCC based compilers (Mingw included)

- Integrated debugging (with GDB)

- Support for multiple languages (localization)

- Class Browser

- Debug variable Browser

- Code Completion

- Function Listing

- Project Manager

- Customizable syntax highlighting editor

- Quickly create Windows, console, static libraries and DLL

- Support of templates for creating your own project types

- Makefile creation

- Edit and compile Resource files

- Tool Manager

- Print support

- Find and replace facilities

- Package manager, for easy installation of add-on libraries

Steps to get started


Start Dev-C++: open start in windows and search or locate Dev-C++
Create new project: File>New>Project then a window will appear in front of you.
Select Console Application from options.
Enter name of project of your choice or enter “LAB 1”
Select radio button with value C++ project.
Click Ok.
A Window with default program will appear on screen.

Files created

The files of the project are saved when the source code file is saved. The remaining files of the project
are saved when the application is compiled and stored in the project folder.
To run a program, the source code must be compiled and linked. Dev-C++ performs the complete
process by clicking the Compile button (or Ctrl + F9).

As a result of the link process, an executable program is created. To run this program, we have to click
the Run button (Ctrl + F10). Alternatively, we can find the executable program (.exe) in the project folder
and double-click on it.

// my first program in C++


#include <iostream>

int main()
{
std::cout << "Hello World!";
}

Line 1: // my first program in C++


Two slash signs indicate that the rest of the line is a comment inserted by the programmer but
which has no effect on the behavior of the program. Programmers use them to include short
explanations or observations concerning the code or program. In this case, it is a brief
introductory description of the program.

Line 2: #include <iostream>


Lines beginning with a hash sign (#) are directives read and interpreted by what is known as
the preprocessor. They are special lines interpreted before the compilation of the program itself
begins. In this case, the directive #include <iostream>, instructs the preprocessor to include a
section of standard C++ code, known as header iostream, that allows to perform standard input
and output operations, such as writing the output of this program (Hello World) to the screen.

Line 3: A blank line.


Blank lines have no effect on a program. They simply improve readability of the code.

Line 4: int main ()


This line initiates the declaration of a function. Essentially, a function is a group of code
statements which are given a name: in this case, this gives the name "main" to the group of
code statements that follow. Functions will be discussed in detail in a later chapter, but
essentially, their definition is introduced with a succession of a type (int), a name (main) and a
pair of parentheses (()), optionally including parameters.

The function named main is a special function in all C++ programs; it is the function called when
the program is run. The execution of all C++ programs begins with the main function, regardless
of where the function is actually located within the code.

Lines 5 and 7: { and }


The open brace ({) at line 5 indicates the beginning of main's function definition, and the closing
brace (}) at line 7, indicates its end. Everything between these braces is the function's body that
defines what happens when main is called. All functions use braces to indicate the beginning
and end of their definitions.

Line 6: std::cout << "Hello World!";


This line is a C++ statement. A statement is an expression that can actually produce some effect.
It is the meat of a program, specifying its actual behavior. Statements are executed in the same
order that they appear within a function's body.

This statement has three parts: First, std::cout, which identifies the standard character output
device (usually, this is the computer screen). Second, the insertion operator (<<), which
indicates that what follows is inserted into std::cout. Finally, a sentence within quotes ("Hello
world!"), is the content inserted into the standard output.

Notice that the statement ends with a semicolon (;). This character marks the end of the
statement, just as the period ends a sentence in English. All C++ statements must end with a
semicolon character. One of the most common syntax errors in C++ is forgetting to end a
statement with a semicolon.

To run a program, the source code must be compiled and linked. Dev-C++ performs the complete
process by clicking the Compile button (or Ctrl + F9).

As a result of the link process, an executable program is created. To run this program, we have to click
the Run button (Ctrl + F10). Alternatively, we can find the executable program (.exe) in the project folder
and double-click on it.
Exercise Lab 1
Name
Registration Number

Task 1: Write lines of code to print your name. Write the code below with ourput. [2]

#include <iostream>

using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or
input loop */

int main(int argc, char** argv) {

cout<<"This is my first programming lab";

return 0;

Task 2: Write the code to print pattern of estericks given below in console.

*
**
***
****
*****
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or
input loop */

int main(int argc, char** argv) {

cout<<"*"<<endl;
cout<<"**"<<endl;
cout<<"***"<<endl;
cout<<"****"<<endl;
cout<<"*****"<<endl;
return 0;
}

Task 3: Write Set of steps to Degree Completion. Note* you are required to write all the cases
starting from admission process to the end semester.
Conditions:
-Student can take admission if marks in test are equal or more than 50%
-Student can add courses up to 18 credit hours at max
-Student must register all courses of current semester having all the
prerequisites clear
-Student can only withdraw course if his or her marks are less than 50% in mid
term exam as per his/her will. Student can only withdraw at most 2 courses.
-if Student CGPA is <2 then student will drop out.
-Student can only register a course if prerequisite is clear.

You might also like