working with ide

10
WORKING WITH INTERGRATED DEVELOPMENT ENVIRONMENT (IDE) PREPARED BY Mrs. Nurul Zakiah

Upload: nurul-zakiah-zamri-tan

Post on 25-May-2015

283 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Working with IDE

WORKING WITHINTERGRATED DEVELOPMENT ENVIRONMENT

(IDE)

PREPARED BY Mrs. Nurul Zakiah

Page 2: Working with IDE

Examples: Visual Studio(VB.NET,C#), Codeblock(C,C++), Netbean(JAVA), Xcode(C#,JAVA,Phyton)

In this lab: DEVC++ for C

Provides to write, editing code

A way to compile/debug the code

Create and Test Your project

Some IDE not only write text but maybe it has embedded with object, Translator, or prescript code which may help the coding is done more easier

Deliver into application that we use

What is IDE??

Page 3: Working with IDE

Example of IDE

Visual Studio

Page 4: Working with IDE

DEVC++

Page 5: Working with IDE

Fundamental of C

Reserved keyword in C must be written as included in the compiler:User cannot change its appearance!

Example int, float, goto, else, char,void, main….Others are printf, scanf, and more..

Variable name cannot be used as same as the reserved keywordC variable refers to the name given to the memory location to

store data

Basically a a program C must have:

Main()

{

}

Page 6: Working with IDE

Rule to name a variable: Must start with alphabet, cant be start with number Can be written in lower and uppercase Cannot use reserved keyword in C Special character not allowed only (_)

Data types Format string

int %d

Unsigned int %u

Float % f

Long %ld

Unsigned long

%lu

double %lf

Long double %lf

char %c /%s

Unsigned char

%c/%s

Data Type:

Page 7: Working with IDE

Operators

Binary Operator

Operator operation Ex

+ addition x=5+6

- subtraction x=10-5

* multiplication x=5*4

/ division x=5/3 =1

% modulo operator

x=5%3 =2

Unary operators:

Operator operation Ex

++ increment i++

-- decrement i--

Page 8: Working with IDE

Relational Operator

Operator operation Ex

> greater than a>b

< less than a<b

>= greater than equal to

a<=b

<= less than equal to a>=b

= = equal to a= =b

!= not equal to a!=b

Logical operators:

Operator operation Ex

&& AND (a>b)&&(a>c)

|| OR (a>b)||(a>c)

Page 9: Working with IDE

#include<stdio.h>

void main()

INT mark;char 1grade;

scan(“%d %c”, &mark, & 1grade);

if(grade = =’a’)

{mark=mark-10;

}printf(“%d”,mark);}

Exercise: Identifying the Error!

Purpose of the program: IF the grade is a, add 10 to the marks

Page 10: Working with IDE

#include<stdio.h>

{float a,b;

void area_rectangle (float, float);clrscr();

printf(“\n enter the length & breadth:”);scanf(“%d %d”, &a, &b);area_rectangle (a,B);getch();}void area_rectangle(x,y)float x,y;{float area;area=x*y;Printf(“\n area of rectangle is %f”, area);return;}

Purpose of the program: To find the rectangle area