Download as pdf or txt
Download as pdf or txt
You are on page 1of 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.


1. Click on "Create a new project".

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


1. In the "Create a new project" window, search for "ASP.NET Web Application (.NET
Framework)".
2. Select "ASP.NET Web Application" and click "Next".
3. Configure your new project: Project Name, Location, Solution Name. Click "Create".

4. In the "Create a new ASP.NET Web Application" window, select "Empty" and click
"Create".
Step 3: Design the Web Form
1. In the Solution Explorer, right click. Click on Add – Web Form Give it an appropriate
name.

2. Switch to the Design view.


3. Design your form by dragging and dropping controls from the Toolbox onto the page:
i. Add four labels. Edit the text on it.
ii. Add four TextBox controls for user input. Set their ID properties to txtNum1,
txtNum2, txtNum3, and txtNum4.
iii. Add a Textbox control to display the result. Set its ID property to txtResult.
iv. Add a Button control to trigger the calculation. Set its ID property to btnCalculate
and Text property to "Calculate Product".
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.
OUTPUT:
PRACTICAL 1B

Aim: Create an application to demonstrate string operations.

Step 1: Set Up Your Project


1. Open Visual Studio 2022.
2. Click on "Create a new project".
3. Select "ASP.NET Web Application (.NET Framework)" and click "Next".
4. Name your project (e.g., StringOperationsWebApp) and choose a location to save it.
Click "Create".
5. In the next window, select "Empty" and click "Create".

Step 2: Design the Web Form


1. Open the Default.aspx file.
2. Switch to the Design view if it is not already open.
3. Design your web form by adding the necessary controls (e.g., TextBoxes, Buttons,
Labels) to perform string operations.

Step 3: Write the Code-Behind


Step 5: Build and Run the Application

OUTPUT:
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:
Step 4: Run the Application

OUTPUT:
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:

a. Generate Fibonacci series.


b. Test for prime numbers.

c. Test for vowels.


d. Use of foreach loop with arrays

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

OUTPUT:

You might also like