C PLU PLU PROGRAMMING-LANGUAGE

 

now day computer education is important part of our life. and we need to learn it..

C++ TUTORIAL - LEARN C++ PROGRAMMING 

Before starting c++ programming or c++language lets understand what is the software .. 

Software is a collection of program. and a program is a collection of instruction.
To develop any software their is requirement of SDLC PROCESS ...
Their are different phase in SDLC PROCESS

SOFTWARE DEVELOPMENT LIFE CYCLE  

COMPUTER EDUCATION-C-C TUTORIAL-C PROGRAMMING LANGUAGES (C LANGUAGE) -SDLC

REQUIREMENT 

First We find what is the requirement of of user..what software or project he/she want to develop. what is his organization requirement.. what is the basic purpose of project..

ANALYSIS

After requirement phase we analyze .how can we develop the software or project.. what kind of language is required and how to make the database according to project..we can ask question from user or search on internet.

DESIGN 


After analyzing project we will start the design part. because it is the one of most important part of SOFTWARE DEVELOPMENT LIFE CYCLE .
we use DFD or other tools to make the project design.. also create the data dictionary to valuate the flow of data.

CODING

now we start the coding part. both coding and design run together. first we select the language to develop the code it may be any programming language..


TESTING

After developing the software or project we test it whether it is working according to need or not. it play important role to check the user requirement .their are many method of testing like,

System Testing, Unit Testing ,alpha testing..


C++ Language (C++ Programming) Introduction

c++ is a oop(object oriented programming language)..is based on object.c++ programming is based on bottom -top flow programming language. it is high level and based on real world programming. C++ is a midle level programming language, as it encapsulates both high and low level language features. C++ is the extenstion of c language.This language is developed by Bjarne Stroustrup starting in 1979 at Bell Lab.  This language (C++ ) runs on a different types of platforms, like Windows, Mac OS, and the various versions of UNIX. This is a increment version of c, basically depends on object oriented programming.

Why to Learn C++ Programming

This language is useful  for both students and  professionals to become a  Software Engineer or Programmer. There are some of the key advantages of learning C++ Programming :

•     1-  C++ is very close to hardware of computer , so you get a chance to work at a low level which gives you lot of control in terms of memory management, better performance While making programs.

•      2- C++ programming is based on real world object , gives understanding about Object Oriented Programming. Before starting this language you should understand C programming.

•    3-  C++ programming has Three main key feature 1- Encapsulation, 2- Polymorphism , 3- Inheritance.

•   4-  C++ is popular programming languages in application and system programming means both for Application and OS. So you professional can choose your area of interest of software development.

•  5- C++  language has strong feature of object oriented programming . After C++ you can easily learn C#.Net Programming language . This language will  teaches you the difference between  translator like compiler, linker and loader, different data types, storage classes, variable types their scopes etc.


To start any programming language we need some basic component of programming language .

A- DELIMITER 

Delimiter are the symbol which are used in programming language for different purpose.

# - for header files

{} - for block use 

() - for any function 

[]- for array

: - used in switch statement  

; - for termination of line

B- DATA TYPES IN C LANGUAGE

Every variable in C has an associated data type. Every data type which is used requires different amounts of memory and performs operations. There  are  examples of some  data types used in C:

int: according to  name it  is used to store an integer value. Like 10,30 . It require 2 byte of memory.

char: This is the  most basic data type in C. It stores a single character at one time  and requires a single byte of memory in almost all compilers.

float: this data type is used to store decimal numbers (numbers with floating point value) with single precision use.

double: It is used to store decimal numbers (numbers with floating point value) with double precision use.COMPUTER EDUCATION-C-C TUTORIAL-C PROGRAMMING LANGUAGES (C LANGUAGE)

C++ - VARIABLES AND KEYWORDS USED 

A variable in simple word  is a name which store some value and some memory allocated to it. So basically a variable used to store some form of data. Different types of variables require different amounts of memory depends on what type of data is there.

How To  Declare Variable:

Data  type variable_name;

For multiple variables Declartion:

 Data type variable1_name, variable2_name, variable3_name;

variable name can consist of alphabets (both upper and lower case), numbers and the underscore ‘_’ character. However, the name  not started   with a number.

DIFFERENCE B/W VARIABLE DECLARATION AND DEFINITION

Variable declaration refers to the part where a variable is first declared or introduced before its first use. Variable definition is the part where the variable is assigned a memory location and a value. Most of the times, variable declaration and definition are done together
Like int a=10; is a Definition or Initialization.

D-  CONST:

const keyword is used to declare constant variables. When we initialized Constant variables, we can’t change their value. constatnt value assigned to them is unmodifiable.

Syntax:

const data_type var_name = var_value;

Note: Constant variables need to be compulsorily be initialized during their declaration itself. The keyword const can used with pointers.


USE BOOL IN C++

CAN APPLY WITH : Bool Data Type in C++

 Theare is  no header file needed to use bool, a header file “stdbool.h” must be included to use bool in C.don’t save the program with .c extension , it will not compile, but if we save it as .cpp, it will work fine.


Example ; with form of array .

int main()
{
  bool arr[2] = {true, false};
  return 0;

}

E- Arithmetic Operators

An arithmetic operator perform airthmetic operations such as addition +, subtraction -, multiplication *, division / etc on numerical values (constants and variables)..

like - int a=10,b=20,c; c=a+b; 

F- Increment and Decrement Operators

Their is two programming operators in c language increment ++ and decrement -- to change the value of an operand by 1.
Increment ++operator  increases the value by 1 whereas decrement operator -- decreases the value by 1. These two operators are unary operators, meaning they only operate on a single operand.

1- For exmp Preincrement: 
int a=5,b;
b=++a;
cout<<a;
cout<<b;

Result is => a=6 and b=6;

2- Postincrement

int a=5,b;
b=a++;
cout<<a;
cout<<b;

Result is => a=7 and b=6;

C++ Class Definitions(What is class)

Class is a collection of object or a blue print or a template. Class contain the data members and memberfuntion for object.in a real world everything is a object.

When you are trying to make a class in c++ . A class definition starts with the keyword class followed by the class name, then declare the datamember and function for obect inside the class ,and the class body, enclosed by a pair of curly braces(Terminated by). A class definition must be followed either by a semicolon or a list of declarations. For example, There is a class with the name Shape data type using the keyword class as follows –how to create class.

class Shape {

   public:

      double length;   // Length of a box

      double breadth;  // Breadth of a box

      double height;   // Height of a box

function(){ }

};

There is different access modifier in C++, Here The keyword public determines the access attributes of the data members of the class that follows it. A public data member and function declared inside the class can be accessed from outside the class anywhere within the scope of the class object. You can also specify the members of a class as private or protected depends on the requirement of program.

C++ Objects Definition-

Object is an real world entity which has attribute and function. In object oriented programming a class provides the blueprints for objects, using object we can easily access the data member and function. We can declare objects of a class with exactly the same sort of declaration that we declare variables. Example how to create object.
Shape Box1;          // Declare Box1 of type Shape.
Shape Box2;          // Declare Box2 of type Shape.
Both of the objects Box1 and Box2 will have their own copy of data members.

 


Comments

Popular posts from this blog

DEVPRAYAG-UTTARAKHAND-INDIA TRAVEL

RANIKHET-UTTARAKHAND TOURISM-INDIA TRAVEL

CHOPTA-UTTARAKHAND-INDIA TRAVEL