0% found this document useful (0 votes)
13 views15 pages

Awp P1

This is Practical 1 of AWP- TYIT Sem V of Mumbai University

Uploaded by

dcruzsophia24
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)
13 views15 pages

Awp P1

This is Practical 1 of AWP- TYIT Sem V of Mumbai University

Uploaded by

dcruzsophia24
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/ 15

PRACTICAL 1A

Aim: Create an application that obtains four int values from the user and displays the
product.

Step 1: Launch Visual Studio 2022.


Click on "Create a new project".

Step 2: Create a New ASP.NET Web Forms Application


o In the "Create a new project" window, search for "ASP.NET Web Application (.NET
Framework)".
o Select "ASP.NET Web Application" and click "Next".

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


o Configure your new project: Project Name, Location, Solution Name. Click "Create".

o In the "Create a new ASP.NET Web Application" window, select "Empty" and click
"Create".

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Step 3: Design the Web Form
o In the Solution Explorer, right click. Click on Add – Web Form Give it an appropriate
name.

o Switch to the Design view.

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


o Design your form by dragging and dropping controls from the Toolbox onto the page:
o Add four labels. Edit the text on it.
o Add four TextBox controls for user input. Set their ID properties to txtNum1, txtNum2,
txtNum3, and txtNum4.
o Add a Textbox control to display the result. Set its ID property to txtResult.
o Add a Button control to trigger the calculation. Set its ID property to btnCalculate and
Text property to "Calculate Product".

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Step 4: Write the Code-Behind
Double click on Button, to handle the calculation part.

Step 5: Build and Run the Application


Save all files. Build the project by selecting Build > Build Solution from the top menu or
pressing Ctrl+Shift+B.
Run the application by selecting Debug > Start Without Debugging or pressing Ctrl+F5.
The application will calculate and display the product of the four integers.

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


OUTPUT:

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


PRACTICAL 1B

Aim: Create an application to demonstrate string operations.

Step 1: Add a Web Form


o Right-click on the project in the Solution Explorer.
o Select Add > Web Form.
o Name the Web Form (e.g., StudentForm.aspx). Click Add.

Step 2: Design the Web Form

Step 3: Write the Code-Behind

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Other functions:
Substring: s.Substring(4, 3)
Upper String: s.ToUpper()
Lower String: s.ToLower()
Replace 's' by 't' in string: s.Replace('s', 't')
Insert 'u' in String: s.Insert(3, "u");
String Truncate: s.Trim()
Remove String: s.Remove(4)
Index of String: s.IndexOf('e')

OUTPUT:

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)
PRACTICAL 1C
Aim: Create an application that receives the (Student Id, Student Name, Course Name,
Date of Birth) information from a set of students. The application should also display
the information of all the students once the data entered.

Step 1: Add a Web Form


o Right-click on the project in the Solution Explorer.
o Select Add > Web Form.
o Name the Web Form (e.g., StudentForm.aspx). Click Add.

Step 2: Design the Web Form


Open StudentForm.aspx and switch to the Design view. Add the following controls to the
form:

Step 3: Code-Behind Logic


Open StudentForm.aspx.cs and add the following code:

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Step 4: Run the Application

OUTPUT:

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


PRACTICAL 1D
Aim: Create an application to demonstrate following operations:
i. Generate Fibonacci series.
ii. Test for prime numbers.
iii. Test for vowels.
iv. Use of foreach loop with arrays
v. Reverse a number and find sum of digits of a number.

Design:

Generate Fibonacci series.

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Test for prime numbers.

Test for vowels.

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Use of foreach loop with arrays

Reverse a number and find sum of digits of a number.

OUTPUT:

Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)


Asst. Prof. Sophia Dcruz TYIT-AWP (Sem V)

You might also like