Вы находитесь на странице: 1из 5

Program 1: Write a program that takes name of the user say xyz using textbox and display hello

xyz in the message box. Blank Sheet:

(do labeling of controls used in design specifying which one is label, Button and textbox)

Other side: Object Label1 Button1 Coding Of Button1: MsgBox("Hello " & TextBox1.Text, , "Result") Program 2: Write a program that takes three numbers using textboxes and calculates average of three numbers. Result should be displayed in textbox. Hint: (make use of labels: number1, result) Program 3: Create a calculator that will perform basic functions: Addition, subtraction, multiplication and division. Property Text Text Setting Name Ok

Object Label1 Label2 Button1 Button2 GroupBox1 RadioButton1 RadioButton1 RadioButton2 RadioButton3 RadioButton4 Coding of Button1:

Property Text Text Text Text Text Text Checked Text Text Text

Setting Input1 Input2 Calculate result End Operator Addition(+) True Subtraction(-) Multiplication(*) Division(/)

Dim FirstNum, SecondNum, Result As Single FirstNum = TextBox1.Text SecondNum = TextBox2.Text If RadioButton1.Checked = True Then

Result = FirstNum + SecondNum ElseIf RadioButton2.Checked = True Then Result = FirstNum - SecondNum ElseIf RadioButton3.Checked = True Then Result = FirstNum * SecondNum Else Result = FirstNum / SecondNum End If MsgBox("Result is :: " & Result, , "Result Box") Coding of Button2: End Program 4: Declare two variables. Accept the values using InputBox() & display the Result of addition in a textbox on form. HINT: Controls: Button and a TextBox Program 5: Accept a number, display whether it is odd or even number. Program 6: Design a screen with 3 radio buttons for 3 different colors. If any one of them selected, change the background color as per the selected color. Program 7: Develop a screen with 4 check boxes for hobbies & one button. After clicking on a button display the hobbies selected. Program 8: Factorial Program 9: Fibonacci Program 10: Find maximum of three numbers using function procedure Program 11: Design a Form as per the specification given below to input two strings and perform string operations a) string comparisons b) finding length of input strings c) to convert input text to uppercase and lowercase Object Text box 1 Text box2 Label 1 Label2 Properties Name Name Name Text Name Text Settings Text1 Text2 Label1 String1 Label2 String2

Button1 Button2

Name Text Name Text Name Text Name Text

Button1 Compare String Button2( give output using message box) Length Button3 To lower case Button4 To Upper Case

Button3 Button4

12. prime 13. scrollbar 14. color argb 15. datetime picker Q1. Declare two variables. Accept the values using InputBox() & display theResult in a textbox on form. Q2. Accept one number using inputbox() & display its factorial in msgbox() Q3. Create a Fibonacci series for 10 numbers Q4. Accept a number check, whether it is prime or not. Q5. Display todays date with day, day name , month & year. Accept a date from user, check whether the year is leap year or not. Q6. Write a function max(a,b,c) which will return maximum of 3 numbers. Q7.Accept a number, display whether it is odd or even number Q8. Design a Form as per the specification given below to input two strings and perform string operations a) string comparisons b) finding length of input strings c) to convert input text to uppercase and lowercase Object Text box 1 Text box2 Label 1 Label2 Properties Name Name Name Text Name Settings Text1 Text2 Label1 String1 Label2

Button1 Button2

Text Name Text Name

String2 Button1 Compare String Button2( give output using message box) Length

Text Button3 Name Button3 Text To lower case Button4 Name Button4 Text To Upper Case Q9. Create a calculator, which will perform basic arithmetic operations like add, subtract, multiply, divide etc. Q10. Develop a screen with 4 check boxes for hobbies & one button. After clicking on a button display the hobbies selected. Q11. Design a screen with 3 radio buttons for 3 different colors. If any one of them selected, change the background color as per the selected color. Q13. Create 3 textboxes to accept values for colors Red, Green, Blue. The range of values be from 0 to 256. As per values of textboxes the color of the form changes. Q14. Create 3 scrollbars for colors Red, Green, Blue. The range of values be from 0 to 256. As per values of scrollbars change the color of label.

Вам также может понравиться