Monday, October 10, 2011

C# chapter-1 introduction.


What is c#?
C#-pronounced as c sharp-is specially created for Dot net.
It is an object oriented language.
It is a modern language
It is easy to learn
It is  based on c,c++ languages.
It produces Efficient program
It contains simplicity of vb, powerful of c++, and elegance of java.


What is.NET?

After the invention of internet java was introduced to create web oriented applications. Java was also a successful one. There is no web language for  Microsoft. Then it  introduced web concepts in vb6. It was a failure. So Microsoft introduced dot-net.
Java creators tell like this
“write once in java and run anywhere”
It means java is a portable language. If you write a java program you can run it on any platform with out change. But you can write in any language in dot-net. Yes ,dot-net supports many languages such as c#,vb,c++ and COBOL.
You can write any language in dot-net. First they are compiled and changed in MSIL(Microsoft intermediate language. Then jit compiler runs the il.the il is not like Microsoft java’s class file. You can not read java’s class files. But MSIL  is a separate language. There are even books for MSIL.

Which languages are supported by .NET?
C#
C++
Visual basic
Jscript
And it also supports third party languages like
Cobol
Eiffel
Perl
Phython
Small talk
Mercury.


1.       Simple
2.       Speed
3.       Contains a lot of library classes. Common to all languages.
4.       Installation is easy
5.       Low exceptions. 


 what type of applications can be created using .NET?

.NET can be used to creating different type of application. Also a .NET solution can consists of projects written in different languages. For example a vb.net project  can contain a data access component written in c#. This is possible because of inter operability of .NET between projects.

What are Console applications?


Console applications means graphics less applications. Only character will be present. The following statement is the entry point of console applications.
Public static void Main(String args)
The project uses Read,ReadLine, Write,WriteLine methods present in the system.console class.


 what are windows applications?

Example for windows application is ms-word. Normally it contain graphics as icon. We may run any commands by just clicking on the icon..Net can be used for creating such applications.
what are windows controls ?
A windows controls can be created using base controls in toolbox. If you have studied active x control creating using vb6 or vc++ it will be very useful to start learning on creating windows controls in .net.
what are web projects?
Web sites can be created using asp.net the server side asp.net engine will convert the asp.net codes in to pure HTML codes. The browser will execute the HTML code and display  website.Asp.net is used to create interactive, dynamic web sites.
what are Web services
The web services provide information to other web sites. For examples a website can get information such as climate, business news from web services. The main aim of the .Net is providing the software as services.



C# and dot-net.
 C# is a language invented specially  for dot-net. Dot-net developers always choose c# language for their programs. C# 4.0 is the recent version c#

Sunday, October 9, 2011

c# chapter-2 Dot net Applications

.NET can be used to creating different type of application. Also a .NET solution can consists of projects written in different languages. For example a vb.net project  can contain a data access component written in c#. This is possible because of interoperability of .NET between projects.
 Console applications
Console applications means graphics less applications. Only character will be present. The following statement is the entry point of console applications.
Public static void Main(String args)
The project uses Read,ReadLine, Write,WriteLine methods present in the system.console class.
Windows applications.
Example for windows application is ms-word. Normally it contain graphics as icon. We may run any commands by just clicking on the icon..Net can be used for creating such applications.
Windows controls
A windows controls can be created using base controls in toolbox. If you have studied active x control creating using vb6 or vc++ it will be very useful to start learning on creating windows controls in .net.
Web projects
Web sites can be created using asp.net the server side asp.net engine will convert the asp.net codes in to pure html codes. The browser will execute the html code and display  website.Asp.net is used to create interactive, dynamic web sites.
Web services
The web services provide information to other web sites. For examples a website can get informations such as climate, business news from webservices. The main aim of the .Net is providing the software as services.

Saturday, October 8, 2011

shortcut keys used in notepad


new- -----  ctrl+n
open-------ctrl+o
save-------ctrl+s
select all-ctrl+a
cut---------ctrl+x
copy------ctrl+c
paste-----ctrl+v
print------ctrl+p
saveas----f6
find--------ctrl+f

Saturday, October 1, 2011

c-3rd chapter


Decision making statements
Decision making statements are used to skip or to execute a group of statements based on the result of some conditions.
Simple if statements
If…else statement
Nested if
Switch statement
If statement
  Logical if statement
Logical if statement is used to execute or skip one statement  or group of statements for a particular conditions.
The general form is
If(test condition)
{
Statements;
}
Next statement




                                                                  
                                                                  
Example:
#include<stdio.h>
#include<conio.h>
Void  main()
{
int mark;
char grade;
clrscr();
Printf(“enter mark and grade”);
scanf("%d %c",&mark,&grade);
if (grade==’A’)
{
mark=mark+10;
}
printf(“%d”,mark);
getch();
}
output:
enter mark and grade: 75,A
85




if---else statement
if…..else statement is used to execute one group of statements if the test condition is true or other group of statements if the condition is false.
the general form is
if(condition)
{
statement block-1;
}
else
{
statement block2;
}
next statement;
<!--[if !vml]--><!--[endif]-->
Example:
#include<stdio.h>
#include<conio.h>
void main()
{
int mark;
clrscr();
printf(“enter mark”);
scanf(“%d”,& mark);
if(mark>=35)
printf(“pass”);
else
printf(“fail”);
getch();
}
output:
enter mark:65
pass



                           


else….if statement
else …if ladder statement is used to take multiway decision. this statement is formed by joing if else statements
the general form is;
if(test condition-1)
{
statement block-1;
}
else if (test condition2)
[
statement block-2
}
…………………….
……………………
else if(test condition-n)
[
statement—n)’
}
else
default statement;
next statement



#include<stdio.h>
#include<conio.h>
void main()
{
int day;
clrscr();
printf(“Give a number between 1 and 7\n”);
scanf(“%d”,&day);
if(day==1)
printf(“Monday\n”);
else if(day==2)
printf(“Tuesday\n”);
else if(day==3)
printf(“Wednesday\n”);
else if(day==4)
printf(“Thursday\n”);
else if(day==5)
printf(“Friday\n”);
else if(day==6)
printf(“Saturday\n”);
else
printf(“Sunday”);
getch();
}
output:
Give a number between 1 and 7:
5
Friday

OTHER EXAMPLES:
/* BIG NO OF A ANDF B*/
#include stdio.h>
#include<conio.h>
void main()
[
int a,b;
clrscr();
printf(“enter a and b”);
scanf(“%d %d”,&a,&b);
if(a>b)
printf(“a is big”);
else
printf(“b  is big”);
getch();

}

output:
enter a and b: 10 15
b is big

what is oops?


object oriented programming


object oriented programming(oop) is used to build oops. objects are the basic building block of object oeiented programming system(oops)
the real world objects have two characteristics:state and behavior.
 for example human beings have state such as name,color,age, and height and behaviors such as walking,dancing and sleeping.
oops consists of following features.
Ee     encapsulation
ab    abstrraction
in     iinheritance
po   poly morphism
Encapsulation:
Encapsulation implies that the non-essential details of an object are hidden fronm the user and an access is provided to its essential details. therefore, encapsulation is also information hiding.
For examplewhen  you switch on the tv the tv starting showing movies. you don’t have to know what is happening in the internal electrical circuits and cathode ray tube and that is hidden from the viewer.
Abstraction:
In object oriented,programming, abstraction means ignoring the non essential; details of an object and concentrating on essential details.
To implement abstraction , you also use the enca0psulation feature . encapsulation hides the irrelavant details of an object and abstraction makesonly relavant features of an object visible.
Inheritance:
In object  oriented methodology , inheritance enables you to extend the functionality   of an existing class. you create a class inherits attributes and behavior of another class. in addition , a new class can consist of a few new attributes and behavior that are specific to the class. interms of  classes and objects,attributes refer to the data  and behavior refer to methods.

Polymorphism:
polymorhism is derived from lathin words poly, which means many, and morph, which means forms.  Any thing that exists in more than one form is known as polymorph.
In object oriented methodology, polymorphism is the feature that enables you to assign a different meaning  or usage to an entity  in different contexts. the entity can be a variable, method, or an object. polymorphism enables an entity to have more than one form depending upon the context in which it is used.