0% found this document useful (0 votes)
35 views

Program

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Program

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

INDEX

S.NO. PROGRAM DETAIL


1. Write a console application program in VB.Net to find the area of a rectangle.
2. Write a console application program in VB.Net to find area of circle and
Circumference of circle.
3. Write a console application program in VB.Net to print day of week.
4. Write a console application program in VB.Net to make calculator.
5. Write a console application program in VB.Net to take two numbers from user and check whether
they are equal or not.
6. Write a console application program in VB.Net to count the total even number present from
range 1 to 50.
7. Write a console application program in VB.Net to print following pattern-1 8 27 64
125 216 343 512 729 1000.
8 Write a console application program in VB.Net to print even and odd number up to 100.

9 Write a console application program in VB.Net to print Fibonacci series.


10 Write a console application program in VB.Net to find greatest of three numbers.
11 Write a console application program in VB.Net to take marks in five subjects and calculate total
and percentage.
12 Write a console application program in VB.Net to print following series- 1 4 9 16 25
36 49 64 81 100.
13 Write a console application program in VB.Net to generate table of given number.

14 Write a console application program in VB.Net to check whether entered input is alphabet,
digit or special symbol.
15 Design a Calculator using VB.Net.
16 Design a login form using VB.Net.
17 Design a form having ListBox and show the functionality of ListBox.
18 Design a form having ComboBox with various items and show the selected item in a ListBox.
19 Design a Restaurant Bill.
20 Design a splash screen.
21 Design an application to prepare student result.
22 Design the form to input electricity unit and calculate total electricity bill according to the given
condition

Unit Charge (Rs/unit)


For first 50 unit 0.50/unit
For first 100 unit 0.75/unit
For first 100 unit 1.2/unit
An additional surcharge of 20% is added to the bill
23 Design windows form for MCQ examination.
24 Create a vb application that lets the user decide the width and height of a shape using scroll bar
control.
25 Develop an application which is similar to notepad using menus.

26 Develop an application using font dialog control.


27 Develop an application using color dialog control.
28 Develop an application to change back color of any control (label, textbox) using scroll box.
29 Write a program to calculate the discount according to the condition and display the output as per
format.
List Price Rate Of Discount
1) Upto rs. 2000 No Discount
2) From rs 2000 to rs 5000 discount 10%
3) From rs 5000 to rs 10000 Discount 15%
Up above rs 10000 Discount 20%
30 Write a program in VB.Net to implement encapsulation in class.
31 Write a program in VB.Net to demonstrate the concept of constructor and destructor.
32 Create a class circle with data member radius; provide member function to calculate area. Derive a
class sphere from class circle; provide member function to calculate volume. Derive class cylinder
from class sphere with additional data member for
height and member function to calculate volume.
33 Write a simple ASP.NET program to display the following Web Controls:
1. A button with text “click me”. The button control must be in the center of the form.
2. A label with a text hello
3.A checkbox.
34 Write a ASP.NET program to display “Welcome To Radiant” in the form when the “click” button
is clicked.
35 Write an ASP.Net program to implement the email validation checking validation controls.The
form title must be ASP.NET.
36 Write an ASP.Net program to implement the validation controls for equality checking of
password and repassword.
37 Write an ASP.Net program to implement the validation controls for checking value of textbox
control with date type value only.
38 Write a program to get a user input such as the boiling point of water and test it to
the appropriate value using CompareValidator.
39 Write a program that uses a textbox for a user input name and validate it for RequiredField
Validation.
40 Declare one TextBox control, one Button control, one Label control, and one
RegularExpressionValidator control in an .aspx file. The submit() function checks if the page is
valid. If it is valid, it returns "The page is valid!" in the Label control. If it is not valid, it returns
"The page is not valid!" in the Label control. If validation fails, the text "The zip code must be
5 numeric digits!" will be displayed in theRegularExpressionValidator control.
41 Check the length of the string in the TextBox using CustomValidator.
42 Create table STUDENT with the following columns and datatypes.
Sid Alphanumeric
Name Varchar(20)
DOB DateTime
Addr Varchar(20)
Contact Varchar(10)
1. Insert following records into the table:
Sid S1 S2 S3
Name OshoJuneja NishantSahni SanyaDua
DOB 28-jan-93 1-oct-92 30-jul-94
Addr ABC XYZ PQR
Contact 9000000000 8000000000 7800000000

ii) Select records from table where age>22.[Use DOB for age calculation].
iii) Count the record in the table.
Display records of the table order by DOB. In ASP.NET Perform using ADO.net

43 Develop an application using the data reader to read from a database.


44 Create following table Student(id, name, course, DOB, address) Write vb.net
application to
Add records
view all the records
Delete the particular record
View all the student who are studying in course MCA using DataSet.
45 Write a vb.net application that perform insert, update and delete operations on Employee table &
perform a navigation operation on employee records using disconnected scenario.
Module Program
Sub Main()
Console.Write("Enter the date (YYYY-MM-DD): ")
Dim inputDate As String = Console.ReadLine()

Dim date As Date = DateTime.Parse(inputDate)

Dim dayOfWeek As String = date.DayOfWeek.ToString()

Console.WriteLine("The day of the week is: " & dayOfWeek)

Console.ReadKey()
End Sub
End Module

Module Program
Sub Main()
Dim dayOfWeek As String = DateTime.Now.DayOfWeek.ToString()

Console.WriteLine("Today is: " & dayOfWeek)

Console.ReadKey()
End Sub
End Module

Module Program
Sub Main()
Console.Write("Enter the first number: ")
Dim num1 As Double = Convert.ToDouble(Console.ReadLine())

Console.Write("Enter the second number: ")


Dim num2 As Double = Convert.ToDouble(Console.ReadLine())

Console.WriteLine("Enter 1 for addition, 2 for subtraction, 3 for multiplication, or 4 for division:")


Dim choice As Integer = Convert.ToInt32(Console.ReadLine())

Dim result As Double

Select Case choice


Case 1
result = num1 + num2
Case 2
result = num1 - num2
Case 3
result = num1 * num2
Case 4
result = num1 / num2
Case Else
Console.WriteLine("Invalid choice")
Return
End Select

Console.WriteLine("The result is: " & result)

Console.ReadKey()
End Sub
End Module

Form Design:

1. Create a new Windows Forms application.


2. Add the following controls to the form:
o Labels:

1. lblRestaurantName (Label to display restaurant name)


2. lblItemName (Label for item name)
3. lblQuantity (Label for quantity)
4. lblPrice (Label for unit price)
5. lblSubtotal (Label to display subtotal)
6. lblTaxRate (Label for tax rate)
7. lblTaxAmount (Label to display tax amount)
8. lblTotal (Label to display total bill amount)

o Text Boxes:
 txtItemName (TextBox to enter item name)
 txtQuantity (TextBox to enter quantity)
 txtPrice (TextBox to enter unit price)
o Buttons:
 btnAdd (Button to add an item to the bill)
 btnClear (Button to clear all input fields)
 btnExit (Button to exit the application)
o List Box:
 ListBox1 (List box to display ordered items with quantity and price)

Code Behind (Form1.vb):

VB.Net
Public Class Form1

Private subTotal As Decimal = 0


Private taxRate As Decimal = 0.1 ' Adjust tax rate as needed

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


' Set initial values (optional)
lblRestaurantName.Text = "Your Restaurant Name"
txtPrice.Enabled = False ' Disable price input (optional)
End Sub

Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click


Dim itemName As String = txtItemName.Text.Trim()
Dim quantity As Integer = Integer.Parse(txtQuantity.Text.Trim())
Dim price As Decimal = Decimal.Parse(txtPrice.Text.Trim())

' Add validation checks for empty fields (optional)

Dim itemTotal As Decimal = quantity * price


subTotal += itemTotal

ListBox1.Items.Add($"{quantity}x {itemName} ({price:C}) - {itemTotal:C}")

' Clear input fields


txtItemName.Text = ""
txtQuantity.Text = ""
End Sub

Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click


ListBox1.Items.Clear()
subTotal = 0
UpdateBillAmounts()
End Sub

Private Sub UpdateBillAmounts()


Dim taxAmount As Decimal = subTotal * taxRate
Dim total As Decimal = subTotal + taxAmount

lblSubtotal.Text = subTotal.ToString("C")
lblTaxRate.Text = (taxRate * 100).ToString("P") ' Display tax rate as percentage
lblTaxAmount.Text = taxAmount.ToString("C")
lblTotal.Text = total.ToString("C")
End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click


Me.Close() ' Close the application
End Sub
End Class
Use code with caution.
Explanation:

1. The code defines variables for subTotal and taxRate.


2. The Form1_Load event sets the initial restaurant name and disables the price input field
(optional).
3. The btnAdd_Click event adds an item to the bill:
o Retrieves item name, quantity, and price.
o Calculates the item total (quantity * price).
o Updates the subTotal variable.
o Adds a formatted string to the lstBillItems list box showing quantity, item name,
price, and item total.
o Clears input fields.
4. The btnClear_Click event clears the list box, resets subTotal, and updates bill amounts.
5. The UpdateBillAmounts method calculates and displays tax amount, tax rate (as
percentage), and total bill amount based on subTotal and taxRate.
6. The btnExit_Click event closes the application.

Customization:

 You can modify the UI layout and add more controls as needed.
 Enhance the code with error handling for invalid input.

You might also like