Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Dot net
1. 1
IT-406
Submitted to:- Submitted by:-
Prof.Vivek Jain Name :- Bhuvnesh Dubey
ITE.Dept. Roll no.:- 0904IT111005
Branch :- Information Technology
Shri Ram College of Engineering and Management
Banmore Morena
Dot Net Lab file
2. 2
Index
S.no. Experiment name Page no. Submission
date
Remark
1. What is dot net? And what are the
features.
03
2. What are the major components of
dot net framework?
04
3. What is c#? Compare with java and
c++?
07
4. What do you mean by pure object
oriented programing language? Is
c# pure object oriented programing
language?
09
5. WAP in c# to display a string on
console screen.
10
6. Write a program for simple
calculation in c#.
11
7. Write a program for finding greater
no. between three numbers.
12
8. Write a program for find total
number, percentage and grade of
student according to its marks.
13
9. Write a program to demonstrate
mathematical calculation in
console form.
14
10. Wap to check the given number is
even or odd.
16
11. Write a program for call by value
function in console form.
17
12. Write a program for call by
reference function in console form.
19
13. Wap to Find max and min no. in
given three numbers.
20
14. Wap to display day for entered any
no. between 1-7 through the
keyboard.
21
3. 3
15. Write a program for simple
calculator in window forms.
23
16. Wap to demonstrate the login form
in the form of window application.
25
17. Wap to find percentage and grades
by giving marks.
27
18. Wap to input your details on
student form and display them.
29
4. 4
//1. What is dot net? And what are the features.
Definition:-
“The .net framework is a development and execution environment that allows
different programming languages and libraries to work together seamlessly to
create windows-based applications that are easier to build, manage, deploy, and
integrate with other networked systems.”
The .net framework is the heart of Microsoft .net .the .net framework is a
software development platform of Microsoft .net .like any platform, it provide a
runtime ,define functionality in some libraries, and supports a set of
programming languages. The .net framework provides a necessary compile-time
and run-time foundation to build and run .net based applications.
Features of .net framework:-
It is a platform neutral framework.
It is a layer between the operating system and the programming language.
It supports many programming languages, including VB.NET, C# etc.
.NET provide a common set of libraries, which can be accessed from any
.NET based programming language. There will be separate set of classes
and libraries for each language.
In future versions of windows, .NET will be freely distributed as part of
operating system and users will never have to install .NET separately.
5. 5
//2. What are the major components of dot net framework?
.NET Framework provides enormous advantages to software developers in
comparison to the advantages provided by other platforms. Microsoft has united
various modern as well as existing technologies of software development in
.NET Framework. These technologies are used by developers to develop highly
efficient applications for modern as well as future business needs.
The following are the key components of .NET Framework:
* .NET Framework Class Library
* Common Language Runtime
* Dynamic Language Runtimes (DLR)
* Application Domains
* Runtime Host
* Common Type System
* Metadata and Self-Describing Components
* Cross-Language Interoperability
* .NET Framework Security
* Profiling
* Side-by-Side Execution.
.Net Framework is a platform that provides tools and technologies to develop
Windows, Web and Enterprise applications.
It mainly contains two components,
1. Common Language Runtime (CLR)
2. .Net Framework Class Library.
1. Common Language Runtime (CLR):-
.Net Framework provides runtime environment called Common Language
Runtime (CLR).It provides an environment to run all the .Net Programs. The
code which runs under the CLR is called as Managed Code. Programmers need
not to worry on managing the memory if the programs are running under the
CLR as it provides memory management and thread management.
Programmatically, when our program needs memory, CLR allocates the
memory for scope and de-allocates the memory if the scope is completed.
Language Compilers (e.g. C#, VB.Net, J#) will convert the Code/Program to
Microsoft Intermediate Language (MSIL) intern this will be converted to
Native Code by CLR.
There are currently over 15 language compilers being built by Microsoft and
other companies also producing the code that will execute under CLR.
6. 6
2. .Net Framework Class Library (FCL):-
This is also called as Base Class Library and it is common for all types of
applications i.e. the way you access the Library Classes and Methods in
VB.NET will be the same in C#, and it is common for all other languages
in.NET.
The following are different types of applications that can make use of .net
Class library.
1. Windows Application.
2. Console Application
3. Web Application.
4. XML Web Services.
5. Windows Services.
In short, developers just need to import the BCL in their language code and use
its predefined methods and properties to implement common and complex
functions like reading and writing to file, graphic rendering, database
interaction, and XML document manipulation.
Below are the few more concepts that we need to know and understand as part
of this .Net framework.
3. Common Type System (CTS):-
It describes set of data types that can be used in different .Net languages in
common. (i.e), CTS ensures that objects written in different .Net languages can
interact with each other.
For Communicating between programs written in any .NET complaint
language, the types have to be compatible on the basic level.
The common type system supports two general categories of types:
Value types:
Value types directly contain their data, and instances of value types are either
allocated on the stack or allocated inline in a structure. Value types can be built-
in (implemented by the runtime), user-defined, or enumerations.
Reference types:
Reference types store a reference to the value's memory address, and are
Allocated on the heap. Reference types can be self-describing types, pointer
types, or interface types. The type of a reference type can be determined from
values of self-describing types. Self-describing types are further split into arrays
and class types. The class types are user-defined classes, boxed value types, and
delegates.
7. 7
4. Common Language Specification (CLS):-
It is a sub set of CTS and it specifies a set of rules that needs to be adhered or
satisfied by all language compilers targeting CLR. It helps in cross language
inheritance and cross language debugging.
Common language specification Rules:
It describes the minimal and complete set of features to produce code that can
be hosted by CLR. It ensures that products of compilers will work properly in
.NET environment.
Sample Rules:-
Representation of text strings.
Internal representation of enumerations.
Definition of static members and this is a subset of the CTS.which all
.NET languages are expected to support.
Microsoft has defined CLS which are nothing but guidelines that
language to follow so that it can communicate withother .NET languages
in a seamless manner.
8. 8
//3. What is c# ? compare with java and c++ ?
C# (pronounced see sharp) is a multi-paradigm programming language
encompassing strong typing, imperative, declarative, functional, procedural,
generic, object-oriented (class-based), and component-oriented programming
disciplines.
It was developed by Microsoft within its .NET initiative and later approved as a
standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006).
C# is one of the programming languages designed for the Common Language
Infrastructure. C# is intended to be a simple, modern, general-purpose, object-
oriented programming language. Its development team is led by Anders
Hejlsberg. The most recent version is C# 5.0, which was released on August 15,
2012.
Comparison between c++ and c#
s.no. C++ C#
A. C++ is designed for general object
oriented programming.
C# is a simple, modern, object
oriented, and type-safe
programming language derived
from C and C++.
B. C++ was designed to be a low-
level platform-neutral object-
oriented programming language.
C# was designed to be a
somewhat higher-level
component-oriented language.
C. These support multiple
inheritances and templates.
There are no multiple inheritances
and
there are no templates
D. C++ code usually compiles to
assembly language.
C# by contrast compiles to
Intermediate language (IL).
E. C++ is not designed to free the
developers from the task of doing
memory management.
C# is designed to free the
developers from the task of doing
memory management
F. C++ is provide a delete operator. There is no equivalent to C++
delete operator in C#.
9. 9
Comparison java and c#:-
s.no. Java C#
A. Java not use namespaces . C#'s namespaces are more similar
to those in C++.
B. Java does not include delegates. C# includes delegates,
C. Java requires that a source file
name must match the only public
class inside it.
C# allows multiple public classes
in the same file.
D. Java does not include operator
overloading.
C# allows operator overloading
E. Java is proprietary, though largely
controlled through an open
community process.
C# is defined by ECMA and ISO
standards
10. 10
// 4. What do you mean by pure object oriented programing language? Is
c# pure object oriented programing language?
Object-oriented programming (OOP) is an approach to software development in
which the structure of the software is based on objects interacting with each
other to accomplish a task. This interaction takes the form of messages passing
back and forth between the objects. In response to a message, an object can
perform an action or method.
A programming language is called a pure object-oriented programming
language. If it support the all features of OOPS.
The basic features of OOPS are:-
1. Data Abstraction
2. Data Encapsulation
3. Polymorphism
4. Inheritance.
5. Classes.
6. Objects.
7. Dynamic binding.
8. Message passing.
9. All pre-defined types are Objects.
10.All operations performed by sending messages to Objects.
C# is not a pure object-oriented programming language because it not support
number 9 and 10 properties of oops.
11. 11
//5. Write a program for print a message on screen.
using System;
class text
{
static void Main(string[] args)
{
Console.WriteLine("hello friends.......n this is Bhuvnesh Dubey");
}
}
Output:-
12. 12
//6. Write a program for simple calculation in c#.
using System;
class calc
{
static void Main(string[] args)
{
int a = 25, b = 25, c,d,e,f;
c = a + b;
d = a - b;
e = a * b;
f = a / b;
Console.WriteLine ("sum of "+a+" and "+b+" is "+c);
Console.WriteLine("subtraction of " + a + " and " + b + " is " + d);
Console.WriteLine("multiplication of " + a + " and " + b + " is " + e);
Console.WriteLine("division of " + a + " and " + b + " is " + f);
}
}
Output :-
13. 13
//7. write a program for finding greater no. between three numbers.
using System;
class greater_no
{
static void Main(string[] args)
{
int a = 10, b = 25,c=50;
Console.WriteLine("number a=" + a);
Console.WriteLine("number b=" + b);
Console.WriteLine("number c=" + c);
if (a > b && a>c)
Console.WriteLine("greater no. is a=" + a);
else if (b > a && b > c)
Console.WriteLine("greater no. is b=" + b);
else
Console.WriteLine("greater no. is c=" + c);
}
}
Output :-
14. 14
//8. Write a program for find total number, percentage and grade of
student according to its marks.
using System;
class grade
{
static void Main(string[] args)
{ int a=80,b=98,c=65,d=85,e=75;
float f, g;
Console.WriteLine("number in subject1 = " + a);
Console.WriteLine("number in subject2 = " + b);
Console.WriteLine("number in subject3 = " + c);
Console.WriteLine("number in subject4 = " + d);
Console.WriteLine("number in subject5 = " + e);
f=(a+b+c+d+e);
g=f/5;
Console.WriteLine("grand total = " + f);
Console.WriteLine("percentage = " + g+"%");
if (g >= 100.00 || g <00.00)
Console.WriteLine("invalid grade please re-enter");
if (g >= 60.00 && g <= 100.00)
Console.WriteLine("congratulation grade is A");
else if (g >= 45.00 && g < 59.99)
Console.WriteLine("congratulation grade is B");
else if (g >= 33.00 && g < 44.99)
Console.WriteLine("congratulation grade is C");
else if (g >= 00.00 && g < 32.99)
Console.WriteLine(" Sorry you are fail !!!!!n work hard in next time");
}
}
Output:-
15. 15
//9. Write a program to demonstrate mathematical calculation in console
form.
using System;
class calc
{static void Main(string[] args)
{float a, b,c;
char d;
Console.WriteLine("enter the number a= ");
a = float.Parse(Console.ReadLine());
Console.WriteLine("enter the number b= ");
b = float.Parse(Console.ReadLine());
Console.WriteLine("which type calculation do you wantn
for addition of two numbers press An
for subtraction of two numbers press Sn
for multiplication of two numbers press Mn
for division of two numbers press Dn");
Console.WriteLine("enter your choice = ");
d = char.Parse(Console.ReadLine());
switch (d)
{case 'A':
case 'a':
c = a + b;
Console.WriteLine("Addition = " + c);
break;
case 'S':
case 's':
c = a - b;
Console.WriteLine("subtraction = " + c);
break;
case 'M':
case 'm':
c = a * b;
Console.WriteLine("Multiplication = " + c);
break;
case 'D':
case 'd':
c = a / b;
Console.WriteLine("division = " + c);
break;
default:
Console.WriteLine("invalid choice");
break;
}} }
17. 17
//10. Wap to check the given number is even or odd.
using System;
class Program
{
static void Main(string[] args)
{
Double a;
Console.WriteLine("Enter number a =");
a = Convert.ToDouble(Console.ReadLine());
if (a%2 ==0)
Console.WriteLine("Entered no. is even");
else Console.WriteLine("Entered no. is odd");
Console.ReadLine();
}
}
Output:-
18. 18
//11. Write a program for call by value function in console form.
Code:-
using System;
class Program
{
static void Main(string[] args)
{
double a, b;
Console.WriteLine("Enter number a =");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter number b =");
b= Convert.ToDouble(Console.ReadLine());
Console.WriteLine("sum of "+a+" and "+b+"is "+add(a, b));
Console.WriteLine("subtraction of " + a + " and " + b + "is " + sub(a, b));
Console.WriteLine("multiplication of " + a + " and " + b + "is " + mul(a, b));
Console.WriteLine("division of " + a + " and " + b + "is " + div(a, b));
Console.ReadLine();
}
static double add(double x, double y)
{
double z;
z = x + y;
return (z);
}
static double sub(double x, double y)
{
double z;
z = x - y;
return (z);
}
static double mul(double x, double y)
{
double z;
z = x * y;
return (z);
}
static double div(double x, double y)
{
double z;
z = x /y;
return (z);
}
}
20. 20
// 12. Write a program for call by reference function in console form.
using System;
class Program
{
static void Main(string[] args)
{
double x,y;
Console.WriteLine("Enter value of a= ");
x=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter value of b= ");
y=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("You entered the values are na= "+x+"nb="+y);
swap(ref x,ref y);
Console.ReadLine();
}
static double swap(ref double a, ref double b)
{
double c;
c = a;
a = b;
b = c;
Console.WriteLine("After swapingnvalue of a= " + a + "nvalue of b= " + b);
return (a);
}
}
Output:-
21. 21
//13. Wap to Find max and min no. in given three numbers.
using System;
class Program
{static void Main(string[] args)
{ Double a, b, c;
Console.WriteLine("Enter number a =");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter number b =");
b = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter number b =");
c= Convert.ToDouble(Console.ReadLine());
if (a>b&& a>c)
Console.WriteLine("Maximum no. is "+a);
else if (b >a && b>c)
Console.WriteLine("Maximum no. is " + b);
else Console.WriteLine("Maximum no. is "+c);
if (a<b && a<c)
Console.WriteLine("Minimum no. is " + a);
else if (b<a && b< c)
Console.WriteLine("Minimum no. is " + b);
else Console.WriteLine("Minimum no. is " + c);
Console.ReadLine();
} }
Output :-
22. 22
//14. Wap to display day for entered any no. between 1-7 through the
keyboard.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace week_day
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "1")
label3.Text = "Day is Sunday";
else if (textBox1.Text == "2")
label3.Text = "Day is Monday";
else if (textBox1.Text == "3")
label3.Text = "Day is Tuesday";
else if (textBox1.Text == "4")
label3.Text = "Day is Wednesday";
else if (textBox1.Text == "5")
label3.Text = "Day is Thursday";
else if (textBox1.Text == "6")
label3.Text = "Day is Friday";
else if (textBox1.Text == "7")
label3.Text = "Day is Saturday";
else
label3.Text = "Invalid Number please re-enter number";
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
label3.Text = "";
}}}
24. 24
//15. Write a program for simple calculator in window forms.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{public partial class Form1 : Form
{public Form1()
{InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{float a, b, c;
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = a + b;
label3.Text=c.ToString();}
private void button2_Click(object sender, EventArgs e)
{float g, h, i;
g= float.Parse(textBox1.Text);
h = float.Parse(textBox2.Text);
i = g - h;
label4.Text = i.ToString();}
private void button3_Click(object sender, EventArgs e)
{float x, y, z;
x = float.Parse(textBox1.Text);
y = float.Parse(textBox2.Text);
z= x * y;
label5.Text =z.ToString();}
private void button4_Click(object sender, EventArgs e)
{
float d, j, f;
d= float.Parse(textBox1.Text);
j= float.Parse(textBox2.Text);
f = d/j;
label6.Text = f.ToString();
} }}
26. 26
//16. Wap to demonstrate the login form in the form of window application.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace log_in
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox3.Text == "Bhuvnesh Dubey" & textBox2.Text ==
"ranu@455" & textBox1.Text == "ranu@455")
MessageBox.Show("log in successfull");
else if(textBox3.Text=="Bhuvnesh Dubey" &
textBox2.Text=="ranu@455" & textBox1.Text!="ranu@455")
MessageBox.Show("Invalid Password ");
else
MessageBox.Show("Invalid Username and Password ");
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}}}
28. 28
//17. Wap to find percentage and grades by giving marks.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace percent
{public partial class Form1 : Form
{public Form1()
{ InitializeComponent();}
private void button1_Click(object sender, EventArgs e)
{float a, b, c, d, f, g;
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = float.Parse(textBox3.Text);
d = float.Parse(textBox4.Text);
f = float.Parse(textBox5.Text);
g = a + b + c + d + f;
label6.Text = g.ToString();}
private void button2_Click(object sender, EventArgs e)
{float a, b, c, d, f, g, h;
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = float.Parse(textBox3.Text);
d = float.Parse(textBox4.Text);
f = float.Parse(textBox5.Text);
g = a + b + c + d + f;
h = g / 5;
label7.Text = h.ToString();
if (h >= 60 && h <= 100)
label8.Text = "Congratulation Grade is A";
else if (h >= 45 && h < 60)
label8.Text = "Congratulation Grade is B";
else if (h >= 33 && h < 45)
label8.Text = "Congratulation Grade is C";
else if (h > 0 && h < 33)
label8.Text = " Sorry.......n your Grade is F nyou are fail!!!!!";
else
label8.Text = "Invalid marksnplease Re-enter your Marks";}}}