This document contains code snippets from multiple C# programming practical assignments. It includes examples of using classes, inheritance, interfaces, delegates and events to solve problems like calculating employee numbers, book details, circle circumference, simple interest, volumes, areas and performing math operations. The later examples demonstrate concepts like nested try-catch blocks, event handling and multicast delegates.
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
This reference will take you through simple and practical approach while learning C++ Programming language.
We describe work in progress on the design and implementation of an SQL-like language for performing complex queries on event streams. This language aims at providing a simple, intuitive and fully non-procedural syntax, while still preserving backwards compatibility with traditional SQL. The syntax and informal semantics of the language are introduced; multiple examples of scenarios taken from past literature are then presented, and used to compare the expressiveness and intuitiveness of the proposed language with respect to existing Complex Event Processing engines.
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
This reference will take you through simple and practical approach while learning C++ Programming language.
We describe work in progress on the design and implementation of an SQL-like language for performing complex queries on event streams. This language aims at providing a simple, intuitive and fully non-procedural syntax, while still preserving backwards compatibility with traditional SQL. The syntax and informal semantics of the language are introduced; multiple examples of scenarios taken from past literature are then presented, and used to compare the expressiveness and intuitiveness of the proposed language with respect to existing Complex Event Processing engines.
This presentation is an introduction to Complex Event Processing (CEP) intended for an practicioners of Runtime Verification. It first describes typical CEP problems, popular tools and their query languages. It then presents BeepBeep 3, an event stream processor that attempts to bridge the gap between RV and CEP. Thanks to BeepBeep’s generic architecture and flexible input language, queries and properties from both fields can be efficiently processed.
Q. Write a function two digit inverse() that reverse the digits of a two-digit integer.
Q. WAP for class account which contains two private data elements, an integer account no and a floating point account balance, and three member function.
Q. Program for Inline functions concept.
Q. WAP for area of circle square and rectangle.
Q. WAP to convert Fahrenheit into Celsius.
Q. WAP that will convert fraction into a mixed number.your function is required in decimal.
Q. WAP to show the use of friend class concept.
Q. WAP to show the concept of Friend Function
Q. WAP to use the concept of constructors and destructors.
Q. Use of default constructor without argument.
This presentation is an introduction to Complex Event Processing (CEP) intended for an practicioners of Runtime Verification. It first describes typical CEP problems, popular tools and their query languages. It then presents BeepBeep 3, an event stream processor that attempts to bridge the gap between RV and CEP. Thanks to BeepBeep’s generic architecture and flexible input language, queries and properties from both fields can be efficiently processed.
Q. Write a function two digit inverse() that reverse the digits of a two-digit integer.
Q. WAP for class account which contains two private data elements, an integer account no and a floating point account balance, and three member function.
Q. Program for Inline functions concept.
Q. WAP for area of circle square and rectangle.
Q. WAP to convert Fahrenheit into Celsius.
Q. WAP that will convert fraction into a mixed number.your function is required in decimal.
Q. WAP to show the use of friend class concept.
Q. WAP to show the concept of Friend Function
Q. WAP to use the concept of constructors and destructors.
Q. Use of default constructor without argument.
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016STX Next
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and keeping short compile times on the other.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up a kotlin-based Android project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin compilation is presented and the language is compared to SCALA and SWIFT.
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
Create the equivalent of a four function calculator. The program should request the user to enter a number, an operator, and another number. carry out the specified arithmetical operation: adding, subtracting, multiplying, or dividing the two numbers. (Using switch statement ).ThesisScientist.com
Pratik Bakane C++ programs...............This are programs desingedby sy diploma student from Governement Polytecnic Thane.....programsare very easy alongwith coding andscreen shot of the output
The C# programming laguage delegates notes Delegates.pptx
P2
1. Practical No.11
Program Name :- WAP in c# , to design a class employee such that it will
automatically emp no. and also keep total no. of employee by using the concept of
static data member function.
Date :- 12/9/2014
using System;
using System.Collections.Generic;
using System.Text;
namespace demo
{
class employee
{
public static void Main()
{
static int i, empno, n, count = 0;
static string name;
Console.WriteLine("How many you want to require?n");
n = int.Parse(Console.ReadLine());
Console.WriteLine("Enter information of the employeen");
for (i = 1; i <= n; i++)
{
Console.WriteLine("Enter name of employeen");
name = Console.ReadLine();
Console.WriteLine("Employee no.ist10" + i);
count++;
}
Console.WriteLine("Total no. of employee=" + count);
Console.ReadKey();
}
}
}
/*********OUTPUT
How many you want to require?
3
Enter information of the employee
Enter name of employee
AAA
Employee no.is 101
Enter name of employee
BBB
Employee no.is 102
Enter name of employee
CCC
Employee no.is 103
Total no. of employee=3 *************/
2. Practical no 12
using System;
classbook
{
pubicintbookno, bookname;
public book(int x, string y)
{
get
{
Console.WriteLine(“Book No. :”+bookno”nBookName : ”+bookname);
}
set
{
bookno=value;
bookname=value;
}
}
classbooktest
{
public static void Main()
{
book b1=new book(1, “E. Balgurusamy”);
}
}
// Practical No. 13
//Program Name :- WAP in C#, to find circumference of circle by using
multilevel inheritance.
//Written By Anand M. Khandre
Date :- 22/9/2014
using System;
using System.Collections.Generic;
using System.Text;
namespace program
{
classdemo
{
publicint r;
3. public demo(int r)
{
this.r = r;
}
publicvirtualvoid display()
{
Console.WriteLine(" Radius of Circle =" + r);
}
}
classdemo1 : demo
{
double c;
public demo1(int r,double x): demo(r)
{
this.x=x;
}
publicoverridevoid display()
{
c = 2 * x * r;
Console.WriteLine(" Cirumferene of Circle =" + c);
}
}
classoverridetest
{
publicstaticvoid Main()
{
demo1 d = newdemo1(5,3.14);
d.display();
Console.ReadKey();
}
}
}
//Practical No. 14
//Program Name :- WAP, to find the simple interest by using multilevel
inheritance.
//Written By Anand M. Khandre
//Date :- 20/9/2014
using System;
using System.Collections.Generic;
using System.Text;
namespace demo
{
publicclass person
{
publicdouble SI,P,R,T;
publicvoid fun1()
4. {
Console.WriteLine("nEnter the value of the total amountn");
P=double.Parse(Console.ReadLine());
Console.WriteLine("nEnter the rate of interestn");
R=double.Parse(Console.ReadLine());
Console.WriteLine("nEnter the time spann");
T=double.Parse(Console.ReadLine());
}
}
class p1: person
{
publicvoid fun2()
{
person.fun1();
SI=((P*R*T)/100);
}
}
class p2: p1
{
publicvoid fun3()
{
p1.fun2();
Console.WriteLine("nSimple interest="+SI);
}
}
class display
{
publicstaticvoid Main()
{
p1 S=new p1();
S.fun2();
p2 I=new p2();
I.fun3();
Console.ReadLine();
Console.ReadKey();
}
}
}
Practical no;-15 Multiple inheritance.
using System;
interface volume
{
double compute(double x);
}
class box : volume
{
public double compute(double x)
{
return(x*x*x);
5. }
}
classcylender : volume
{
public double compute(double x)
{
public double h;
h=6;
return(3.14*x*x*h);
}
}
class cone : volume
{
public double compute(double x)
{
return(0.33*3.14*x*x*h);
}
}
classinttest
{
pubic static void Main()
{
box b=new box();
cylinder c=new cylinder();
cone c1=new cone()
volume v;
v=b as volume;
Console.WriteLine(“Volume of box=”+v.compute(12));
v=c as volume;
Console.WriteLine(“Volume of cylender=”+v.compute(10));
v=c1 as volume;
Console.WriteLine(“Volume of cone=”+v.compute(14));
}
}
6. //Practical No. 16
//Program Name :- WAP, to find the area of trapezium and cube by using the
concept of multiple implementation of interface.
//Written By Anand M. Khandre
//Date :- 22/9/2014
using System;
using System.Collections.Generic;
using System.Text;
interfacetrap
{
double a1();
}
interfacecube
{
double a2();
}
classval : trap, cube
{
double a, b, h;
public val(double a, double b, double h)
{
this.a = a;
this.b = b;
this.h = h;
}
publicint a1()
{
return (0.5*(a+b)*h);
}
publicint a2()
{
return (6 * a * a);
}
}
classdisplay
{
publicstaticvoid Main()
{
val d=newval(10,20,30);
trap t=(trap)d;
Console.Write("Area of trapazium="+t.a1());
cube c=(cube)d;
Console.Write("Surface area of cube="+c.a2());
Console.ReadKey();
}
}
7. // Practical No. 18
//Program Name :- WAP in C#, to add and multiply of two nos. by using
concept of delegate.
//Written By Anand M. Khandre
Date :- 1/10/2014
using system;
delegateintarithop(intx,int y);
classmathop
{
public static int add(inta,int b)
{
return(a+b);
}
public static intmul(inta,int b)
{
return(a*b);
}
}
classdelegatetest
{
public static void Main()
{
arithopo1=new arithop(mathop.add);
arithop o2=new arithop(mathop.mul);
int result1=o1(200,100);
int result2=o2(22,20);
Console.WriteLine(“Addition =”+result1);
Console.WriteLine(“Multiplication=”+result2);
Console.ReadKey();
}
}
8. // Practical No. 19
//Program Name :- WAP in C#, to implement the concept of nested tryblock.
//Written By Anand M. Khandre
Date :- 29/9/2014
using system;
classnestedtry
{
staticint m=10;
staticint n=0;
static void division()
{
try
{
int k =m/n;
}
catch(Argument Exception e)
{
Console.WriteLine(“Caught an expection ”);
}
}
public static void Main()
{
try
{
division();
}
catch(DivideByZeroException e)
{
Console.WriteLine(“ Caught an exception”);
}
finally
{
Console.Write(“Inside Main Method”)
}
Console.ReadKey();
}
}
9. //// Practical No. 20
//Program Name :- WAP in C#, to implement the concept of event handling.
//Written By Anand M. Khandre
Date :- 28/9/2014
using System;
using System.Collections.Generic;
using System.Text;
publicdelegatevoidEdelegate(string str);
classEventclass
{
publiceventEdelegate status;
publicvoid Trigger()
{
if (status!=null)
{
status("Event triggered");
}
}
}
classEventtest
{
publicstaticvoid Main()
{
Eventclass ec=newEventclass();
Eventtest et= newEventtest();
ec.status +=newEdelegate(et.Eventcatch);
ec.Trigger();
}
publicvoid Eventcatch(string str)
{
Console.WriteLine(str);
Console.ReadKey();
}
}
//output
Event triggered
// Practical No. 22
//Program Name :- WAP in C#, to implement the multicast delegate.
//Written By Anand M. Khandre
Date :- 28/9/2014
10. using System;
using System.Collections.Generic;
using System.Text;
delegatevoidMdelegate();
classDM
{
staticpublicvoid display()
{
Console.WriteLine("New Delhi");
}
staticpublicvoid print()
{
Console.WriteLine("New York");
}
}
classMtest
{
publicstaticvoid Main()
{
Mdelegate m1 = newMdelegate(DM.display);
Mdelegate m2 = newMdelegate(DM.print);
Mdelegate m3 = m1 + m2;
Mdelegate m4 = m2 + m1;
Mdelegate m5 = m3 - m2;
m3();
m4();
m5();
Console.ReadKey();
}
}
//output
New Delhi
New York
New York
New Delhi
New Delhi