net file
net file
7. Working with:
Message Boxes; Dialog Boxes; Menus; Toolbars
8. Write a program to store student information in
database.
9. Working with Web Forms server controls; label;
dropdown list box; Button; AdRotator; Textbox;
Checkbox etc.
10. Write a program to make an admission form.
11. Write a program to convert different types of
variables into string
12. Write a program to implement concept of delegates
on Array List
13. Write a program to implement concept of Jagged
Array
14. Write a program to implement calculator
INPUT:
Module Module1
Sub Main()
Console.WriteLine("Hello World")
Console.ReadLine()
End Sub
End Module
OUTPUT:
2: Write a program to show a message box with text inside.
INPUT:
OUTPUT:
3: Write a program to perform Arithmetic operation.
INPUT:
OUTPUT:
Line 1 - Value of c is 31
Line 2 - Value of c is 11
Line 3 - Value of c is 210
Line 4 - Value of d is 2.1
Line 5 - Value of c is 2
Line 6 - Value of c is 1
Line 7 - Value of c is 100
4: Write a program to calculate simple interest.
INPUT:
Imports System
simpleInterest(1500, 3, 7.3)
simpleInterest(170.4, 7, 3.4)
End Sub
End Class
OUTPUT:
5: Write a Program to calculate area of some mathematical figure.
INPUT:
Module Module1
Sub Main()
End Sub
End Module
OUTPUT:
6: Write a program to draw pattern.
INPUT:
Imports System
Module Module1
Sub Main()
Dim a, b, num As Integer ' initialize the local variable
Console.WriteLine(" Enter the number of rows: ")
num = Console.ReadLine() ' take an input from the user
For a = 1 To num
For b = 1 To a
Console.Write("* ") ' print the star
Next
Console.WriteLine("") ' jump to new line
Next
Console.WriteLine(" Press any key to exit...")
Console.ReadKey()
End Sub
End Module
OUTPUT:
7: Working with:
Message Boxes; Dialog Boxes; Menus; Toolbars
Message Box:
Input:
Output:
Dialog Box:
Input:
Output:
Menus:
Input:
Output:
Toolbar:
Input:
Output:
8:Write a program to store student information in database.
Output:
9:Working with Web Forms server controls; label; dropdown list
box; Button; Textbox; Checkbox
Output:
Button:
Input:
Output:
Code Behind:
Output:
Checkbox:
Input:
Output:
Code behind:
Output:
DropDown List:
Input:
Output:
Code Behind:
Output:
10. Write a program to make an admission form.
<table align="center" class="style1" style="border: thin solid #008080">
<tr>
<td colspan="3"
Admission Form</td>
</tr>
<tr>
<td class="style5">
</td>
<td class="style4">
</td>
<td>
</td>
</tr>
<tr>
<td class="style6">
FirstName :
</td>
<td class="style4">
</td>
<td>
SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style6">
LastName :
</td>
<td class="style4">
</td>
<td>
SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style6">
City :
</td>
<td class="style4">
</td>
<td>
SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style6">
Email :
</td>
<td class="style4">
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
SetFocusOnError="True"></asp:RequiredFieldValidator>
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-
.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style6">
Password :</td>
<td class="style4">
</td>
<td>
SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style5">
</td>
<td class="style4">
onclick="btnregistration_Click" />
</td>
<td>
</td>
</tr>
<tr>
<td class="style5">
</td>
</td>
</tr>
<tr>
<td colspan="3">
</asp:GridView>
</td>
</tr>
</table>
lblmsg.Text = "";
SQLAdapter.Fill(DT);
GridView1.DataSource = DTT;
GridView1.DataBind();
txtfname.Text = "";
txtlname.Text = "";
txtemail.Text = "";
txtcity.Text = "";
txtfname.Focus();
OUTPUT:
11. Write a program to convert different types of variables into
string.
Module Module1
Sub Main()
Dim a As Double = 123456.789
Dim b As Integer = 123
Dim c As Byte = 123
Dim d As Boolean = False
str = a.ToString()
Console.WriteLine(str)
str = b.ToString()
Console.WriteLine(str)
str = c.ToString()
Console.WriteLine(str)
str = d.ToString()
Console.WriteLine(str)
Console.ReadLine()
End Sub
End Module
OUTPUT:
12.Write a program to implement concept of delegates on Array
List:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Delegates_demo
{
public delegate int Mydelegate(int x,int y);
class sample
{
public static int rectangle(int a, int b)
{
return a * b;
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("My simple Delegate Program");
Console.ReadKey();
}
}
}
OUTPUT:
13. Write a program to implement concept of Jagged Array:
using System;
class GFG {
OUTPUT:
14.Write a program to implement calculator
using System;
using System.Text;
using System.Threading.Tasks;
namespace calculator_c_sharp
class Program
string value;
do
int res;
Console.Write("Enter symbol(/,+,-,*):");
switch (symbol)
case "+":
Console.WriteLine("Addition:" + res);
break;
case "-":
Console.WriteLine("Subtraction:" + res);
break;
case "*":
Console.WriteLine("Multiplication:" + res);
break;
case "/":
Console.WriteLine("Division:" + res);
break;
default:
Console.WriteLine("Wrong input");
break;
Console.ReadLine();
value = Console.ReadLine();
OUTPUT:
15.Write a program to demonstrate the join()method of string
class:
using System;
public class Demo {
public static void Main(string[] args) {
string[] strArr = {"AB", "BC", "CD", "DE", "EF", "FG", "GH", "IJ" };
Console.WriteLine("String Array...");
foreach(string s in strArr) {
Console.WriteLine(s);
}
string str = string.Join("*", strArr);
Console.WriteLine("Result (after joining) = " + str);
}
}
OUTPUT:
16.Write a program to create a user-defined function to add two
integers:
using System;
class AddTwoNumbers {
//defining function
return x+y;
try{
int a = 0;
int b = 0;
a = Convert.ToInt32(Console.ReadLine());
b = Convert.ToInt32(Console.ReadLine());
catch(Exception ex){
OUTPUT: