Skip to main content

Posts

Showing posts from August 18, 2013

VBA LAB Exercises (SimulatioModeling)

                                                   Even Roll No.s Write a program in VB to pick a value from the excel and sheet and print out its square root,cube root on the excel sheet. Also, check whether the number is prime or not.  Once this task is complete take a range of values (depicting arrival of customer) from excel and generate its cumulative frequency and using a rand function  generate arrival distribution Odd RollNO.s Write a program in VB to pick two values from the  excel and sheet and print out their addition and multiplication results on the excel sheet.  Also, check whether the sum of number is even or odd  Once this task is complete take a range of values (depicting arrival of customer) from excel and generate its cumulative frequency and using a rand function   generate arrival distribution.  Simulate this process for generating arrival of 100 customers. 1.   Assignment      Generate a set of random numbers taking input seed from

Code for printing the grade of a studente on Excel sheet using VBA

Private Sub CommandClicking_Click() Dim m As Integer Dim g As String Randomize Timer m = Int(Rnd * 100) Cells(10, 1).Value = m If m < 35 And m >= 0 Then g = "F" Cells(11, 1).Value = g ElseIf m < 55 And m >= 35 Then g = "E" Cells(11, 1).Value = g ElseIf m < 65 And m >= 55 Then g = "D" Cells(11, 1).Value = g ElseIf m < 75  And m >= 65 Then g = "B" Cells(11, 1).Value = g ElseIf mark < 90 And mark >= 75 Then g = "A" Cells(11, 1).Value = g ElseIf mark < 100 And mark >= 90 Then grade = "A*" Cells(11, 1).Value = g End If End Sub