0% found this document useful (0 votes)
27 views8 pages

Dim EmployeeName As String

The document contains code for multiple scenarios involving employees, students, and products. It defines variables to store information and uses input boxes to collect data. Conditional logic like If/Then and Select Case is used to check the input data and return different messages based on the variable values. The code demonstrates basic programming concepts like variables, input, conditional statements, and message boxes.

Uploaded by

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

Dim EmployeeName As String

The document contains code for multiple scenarios involving employees, students, and products. It defines variables to store information and uses input boxes to collect data. Conditional logic like If/Then and Select Case is used to check the input data and return different messages based on the variable values. The code demonstrates basic programming concepts like variables, input, conditional statements, and message boxes.

Uploaded by

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

Dim EmployeeName As String

Dim EmployeeAge As Integer

Dim EmployeeSalary As Double

Sub MyProgram()

MsgBox "My First Program"

End Sub

Sub scenario1()

EmployeeName = InputBox("Enter Employee Name")

EmployeeAge = InputBox("Enter Employee Age")

EmployeeSalary = InputBox("Enter Employee Salary")

MsgBox EmployeeName

MsgBox EmployeeAge

MsgBox EmployeeSalary

End Sub

Sub scenario2()

EmployeeSalary = InputBox("Enter Employee Salary")

If EmployeeSalary > 50000 Then

MsgBox "High Cost Resource"

Else

MsgBox "Low Cost Resource"

End If
End Sub

Sub scenario3()

EmployeeAge = InputBox("Enter Employee Age")

EmployeeSalary = InputBox("Enter Employee Salary")

If EmployeeAge > 50 And EmployeeSalary < 20000 Then

MsgBox "Bonus Allowed"

Else

MsgBox "Bonus not Allowed"

End If

End Sub

Sub scenario4()

EmployeeAge = InputBox("Enter Employee Age")

Select Case EmployeeAge

Case Is < 25

MsgBox "Junior"

Case 23 To 35

MsgBox "Executive"

Case 35 To 45

MsgBox "Manager"

Case 45 To 55

MsgBox "Sr Manager"

Case Is > 55

MsgBox "CXO"
End Select

End Sub

Sub scenario5()

EmployeeName = InputBox("Enter Employee Name")

EmployeeAge = InputBox("Enter Employee Age")

EmployeeSalary = InputBox("Enter Employee Salary")

MsgBox "Employee Name is " & EmployeeName

MsgBox "Employee Age is " & EmployeeAge

MsgBox "Employee Salary is " & EmployeeSalary

MsgBox "Employee " & EmployeeName & "Is " & EmployeeAge & " Years old."

End Sub
Dim StudentName As String

Dim StudentAge As Integer

Dim DistanceFromHome As Integer

Sub scenario1()

StudentName = InputBox(" Enter Student Name")

StudentAge = InputBox("Enter Student Age")

If StudentAge < 5 Then

MsgBox "Not Admitted"

Else

MsgBox "Admitted"

End If

End Sub

Sub scenario2()

StudentName = InputBox(" Enter Student Name")

DistanceFromHome = InputBox(" Enter Distance From Home")

If DistanceFromHome > 10 Then

MsgBox "Not Admitted"

Else

MsgBox "Admitted"

End If

End Sub
Sub scenario3()

StudentName = InputBox(" Enter Student Name")

StudentAge = InputBox("Enter Student Age")

DistanceFromHome = InputBox(" Enter Distance From Home")

If StudentAge > 5 And DistanceFromHome < 10 Then

MsgBox "Admitted"

Else

MsgBox "Not Admitted"

End If

End Sub

Sub scenario4()

StudentName = InputBox(" Enter Student Name")

StudentAge = InputBox("Enter Student Age")

Select Case StudentAge

Case Is < 5

MsgBox "Not Admitted"

Case 5 To 12

MsgBox "Junior"

Case 12 To 16

MsgBox "Senior"

Case Is > 16

MsgBox "Super Senior"

End Select

End Sub
Sub scenario5()

StudentName = InputBox(" Enter Student Name")

StudentAge = InputBox("Enter Student Age")

MsgBox "student"

End Sub

Dim ProductName As String

Dim ProductPrice As Double

Dim OrderQuantity As Double

Dim ordervalue As Double

Sub scenario1()

ProductName = InputBox(" Enter Product Name")

ProductPrice = InputBox(" Enter Product Price")

If ProductPrice < 5000 Then

MsgBox "Low cost product"

Else

MsgBox "High cost product"

End If

End Sub

Sub scenario2()
ProductName = InputBox(" Enter Product Name")

OrderQuantity = InputBox(" Enter Order Quanity")

If OrderQuantity > 1000 Then

MsgBox "Huge Order"

Else

MsgBox "Small Order"

End If

End Sub

Sub scenario3()

ProductName = InputBox(" Enter Product Name")

ProductPrice = InputBox(" Enter Product Price")

OrderQuantity = InputBox(" Enter Order Quanity")

If ProductPrice > 5000 And OrderQuantity > 1000 Then

MsgBox "Big Order"

Else

MsgBox "Small Order"

End If

End Sub

Sub scenario4()

ProductName = InputBox(" Enter Product Name")

ordervalue = InputBox("Enter Order Value")

Select Case ordervalue


Case Is < 5000

MsgBox " 0%"

Case 5000 To 12000

MsgBox "10%"

Case 12000 To 16000

MsgBox " 20%"

Case Is > 16000

MsgBox " 30%"

End Select

End Sub

Sub senario5()

ProductName = InputBox(" Enter Product Name")

ProductPrice = InputBox(" Enter Product Price")

MsgBox "Product " & ProductName & "cost " & ProductPrice & "per unit"

End Sub

You might also like