0% found this document useful (0 votes)
37 views25 pages

Awp Practical Sem5

The document is a journal for the T.Y. BSc.IT Semester 5 course on Advanced Web Programming at DTSS College of Commerce, detailing the completion of various programming projects by student Aniket Sanjay Durgawale. It includes practical exercises such as implementing arithmetic operations, string methods, inheritance, and web applications using C#. The journal is certified by the guidance teacher and includes an index of practicals with corresponding page numbers.

Uploaded by

rinatanvar450
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views25 pages

Awp Practical Sem5

The document is a journal for the T.Y. BSc.IT Semester 5 course on Advanced Web Programming at DTSS College of Commerce, detailing the completion of various programming projects by student Aniket Sanjay Durgawale. It includes practical exercises such as implementing arithmetic operations, string methods, inheritance, and web applications using C#. The journal is certified by the guidance teacher and includes an index of practicals with corresponding page numbers.

Uploaded by

rinatanvar450
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

PCP Center : DTSS College of Commerce, Malad (E)

T.Y. BSc.IT
Semester – 5

2022-23
ADVANCED WEB PROGRAMMING
Journal

Guidance Teacher :

Prof. Utkarsh Jagannath Bhat

Student Name:

ANIKET SANJAY DURGAWALE


Application ID : 121226

1
University of Mumbai

Institute of Distance and Open Learning (IDOL)


Dr. Shankar Dayal Sharma Bhavan, Vidyanagari, Santacruz(E)

PCP Center : DTSS College of Commerce, Malad (E)

Certificate
This is to certify that Mr/Ms. ANIKET SANJAY DURGAWALE of TY BSc .I.T.
Semester 5 has completed the specified term/Project work in the subject of
ADVANCED WED PROGRAMMING Project Titled in satisfactorily manner
within this institute as laid down by University of Mumbai during the
academic year 2022 to 2023.

Subject Teacher IDOL B.Sc. - I.T Co-ordinator

Examiner

Date: College Seal

2
Index
Sr. PRACTICAL NAME Pg No
No
1 Write a program to input 4 numbers and print their product. 4

2 Write a program to implement string method 5


3 Write a program to implement switch case fall through statement. 6
4 Write a program to implement foreach loop 8
5 Write a program to implement function overloading. 9

6 Write a program to implement multiple inheritance 10


7 Write a program to implement single inheritance 11
8 Web Application 13
9 Write a web application to create a calculator using e-sharp. 15
10 Web Application 17

3
PRACTICAL NO : 1

Q1. Write a program to input 4 numbers and print their product.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

class Program

static void Main(string[] args)

int a, b, c, d, add, multi, div;

Console.WriteLine("Enter first number:");

a=Convert.ToInt32 (Console.ReadLine());

Console.WriteLine("Enter Second number:");

b = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("Enter third number:");

c = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("Enter Fourth number:");

d = Convert.ToInt32(Console.ReadLine());

add = a + b + c + d;

multi = a * b * c * d;

div = a / b / c / d;

Console.WriteLine("The sum of the 4 no.s:" + add);

Console.WriteLine("The product of the 4 no.s:" + multi);

Console.WriteLine("The division of the 4 no.s:" + div);

Console.ReadLine();

4
}

OUTPUT:-

5
PRACTICAL NO : 2

Q2. Write a program to implement string method.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication3

class Program

static void Main(string[] args)

string s1 = "abc";

string s2 = "pqr";

Console.WriteLine("string methods:\n");

Console.WriteLine("string 1:" + s1 + "string2:" + s2);

Console.WriteLine("Concatenated stirng:" + string.Concat(s1, s2));

Console.WriteLine("s1 ends with?" + s1.EndsWith("C"));

Console.WriteLine("Uppercase string s2:" + s2.ToUpper());

Console.WriteLine("Index of 'q' in string s2:" + s2.IndexOf("q"));

Console.ReadLine();

6
OUTPUT:-

7
PRACTICAL NO : 3

Q3. Write a program to implement switch case fall through statement.


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication5

class Program

static void Main(string[] args)

char ch;

Console.WriteLine("Enter Alphabet");

ch = Convert.ToChar(Console.ReadLine());

switch (Char.ToLower(ch))

case 'a':

Console.WriteLine("Vowel");

Console.ReadLine();

break;

case 'e':

Console.WriteLine("Vowel");

Console.ReadLine();

break;

case 'i':

Console.WriteLine("Vowel");

Console.ReadLine();

break;

8
case 'o':

Console.WriteLine("Vowel");

Console.ReadLine();

break;

case 'u':

Console.WriteLine("Vowel");

Console.ReadLine();

break;

default:

Console.WriteLine("Not a Vowel");

Console.ReadLine();

break;

OUTPUT:-

9
PRACTICAL NO : 4

Q 4. Write a program to implement foreach loop

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication6

class Program

static void Main(string[] args)

string[] colourname = new string[] { "Red", "Yellow", "Black", "Blue" };

Console.WriteLine("Use Of foreach loop");

foreach(String color in colourname)

Console.WriteLine(color);
}

Console.ReadLine();

OUTPUT:-

10
PRACTICAL NO : 5

Q5. Write a program to implement function overloading.

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace methodoverloading

class Program

static void sum(int a,int b)

Console.WriteLine("sum of interger" + "" + a + "" + "and" + "" + "" + b + "" + "is:-" + (a + b));

static void sum(float a,float b)

Console.WriteLine("sum of float"+""+a+""+"and"+"+"+b+"is:-"+(a+b));

static void sum(double a,double b)

Console.WriteLine("sum of double"+""+a+""+"and"+""+""+b+"is:-"+(a+b));

static void Main(string[] args)

Console.WriteLine("Function overloading");

sum (2,3);

sum (3.4,4.5);

11
sum (1.343,1.763);

Console.ReadKey();

OUTPUT:-

12
PRACTICAL NO : 6
Q6. Write a program to implement multiple inheritance.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace multiInherit
{
public class A
{
public A()
{
Console.WriteLine("Hi, I am from class A");
}
}
public class B:A
{
public B()
{
Console.WriteLine("Hi, I am from class B i.e child of
class B");
}
}
public class C:B
{
public C()
{
Console.WriteLine("Hi, I am from class C i.e child of
class B");

13
}
}
class program
{
static void Main(string[] args)
{
C C2=new C();
Console.ReadKey();

}
}
}

OUTPUT:-

14
PRACTICAL NO : 7
Q7. Write a program to implement single inheritance
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Singleinheritance

class shape

public void setcolor(int color)

drawcolor = (ConsoleColor)color;

Console.ForegroundColor = drawcolor;

protected ConsoleColor drawcolor;

protected int width;

protected int height;

protected int radius;

class Myreact : shape

public void setw(int w)

width = w;

public void seth(int h)

height = h;

15
public double getArea()

return (width * height);

class Mycircle : shape

public void setr(int r)

radius = r;

public double getArea()

return (3.14 * radius * radius);

class Program

static void Main(string[] args)

Myreact r1 = new Myreact();

Mycircle c1 = new Mycircle();

r1.setw(6);

r1.seth(7);

c1.setr(8);

r1.setcolor(9);

r1.setcolor(10);

Console.WriteLine("Area of Rectangle:-" + (r1.getArea()));

Console.WriteLine("Area of Rectangle:-" + (c1.getArea()));

Console.ReadKey();

16
}

OUTPUT:-

17
PRACTICAL NO : 8

Q8. Web Application:-


using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication20

public partial class WebForm1 : System.Web.UI.Page

protected void Page_Load(object sender, EventArgs e)

protected void TextBox2_TextChanged(object sender, EventArgs e)

protected void TextBox3_TextChanged(object sender, EventArgs e)

protected void Button1_Click(object sender, EventArgs e)

18
int r;

r = Convert.ToInt32(TextBox1.Text) * Convert.ToInt32

(TextBox2.Text) * Convert.ToInt32(TextBox3.Text) * Convert.ToInt32(TextBox4.Text);

Label3.Text = "Result:" + r.ToString();

protected void Button2_Click(object sender, EventArgs e)

TextBox1.Text = " ";

TextBox2.Text = " ";

TextBox3.Text = " ";

TextBox4.Text = " ";

Label3.Text = " ";

19
Output:-

20
PRACTICAL NO : 9

Q9. Write a web application to create a calculator using e-sharp.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication22

public partial class WebForm1 : System.Web.UI.Page

protected void Page_Load(object sender, EventArgs e)

protected void Button1_Click(object sender, EventArgs e)

TextBox3.Text = (Convert.ToInt32(TextBox1.Text) +
Convert.ToInt32(TextBox2.Text)).ToString();

protected void Button5_Click(object sender, EventArgs e)

TextBox3.Text=(Convert.ToInt32(TextBox1.Text) - Convert.ToInt32(TextBox2.Text)).ToString();

protected void Button3_Click(object sender, EventArgs e)

21
{

TextBox3.Text = (Convert.ToInt32(TextBox1.Text) *
Convert.ToInt32(TextBox2.Text)).ToString();

protected void Button4_Click(object sender, EventArgs e)

TextBox3.Text = (Convert.ToInt32(TextBox1.Text) /
Convert.ToInt32(TextBox2.Text)).ToString();

protected void Button6_Click(object sender, EventArgs e)

TextBox3.Text = " ";

TextBox3.Text = " ";

TextBox3.Text = " ";

TextBox3.Text = " ";

Label3.Text = " ";

22
Output:-

23
PRACTICAL NO : 10

Q10. Web Application

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication5

public partial class WebForm1 : System.Web.UI.Page

protected void Page_Load(object sender, EventArgs e)

protected void Button1_Click(object sender, EventArgs e)

try

int val = Convert.ToInt32(TextBox1.Text);

int div = Convert.ToInt32(TextBox2.Text);

int resultval;

resultval = (val / div);

Label2.Text = "result is:" + resultval.ToString();

catch (System.Exception ex)

24
Label2.Text = "exception catch here details:" + ex.ToString();

finally

Label3.Text = "Enter finally block";

protected void TextBox2_TextChanged(object sender, EventArgs e)

Output:-

25

You might also like