VB Assignment Set 2 - Review


Things you need to know to complete this programming assignment set :


  1. Create the interface for the program below to calculate the volume of a cylinder.  Be sure to rename all controls and set all properties before entering any code.  Add comments to the general declarations section of the form.


  1. Follow the steps below to create a program that calculates the Area of a rectangle.



    1. Add two textboxes, four labels, and one command button to a form.
    2. Change the Caption property of the 1st label to Enter Base, the 2nd label to Enter Height & the 3rd to The area is:
    3. Delete the text from the Text property of both textboxes and the other 4th label.
    4. Change the border style of the 4th label to Fixed Single.
    5. Make the two text boxes and the 4th label the same size by selecting all 3 and choosing Format --> Make Same Size --> Both
    6. Change the Caption property of the command button to Calculate.
    7. Centre the command button by selecting it and choosing Format --> Center in Form --> Horizontally
    8. Change the Name property of  the 1st text box to txtBase,  the 2nd text box to txtHeight , the 4th label to lblArea and the command button to cmdCalculate.
    9. Double-click on the command button to enter code for the click event.  Remeber to use the Val ( ) function to convert a string to its numeric equivalent.
    10. You will need to declare 3 variables. You will need variables for the s Area, s Base, sHeight as Single
    11. The area of a rectangle is the base * height.
    12. Create a new folder called Assign 2B
    13. Save the form and the project as carroll_ics_assign2b_yourname

  1. Write a program that converts any number of days into hours.  All values should be entered in textboxes and then stored in variables to be used in calculations. The output should be in a separate label and a command button should cause the calculation.  Create a new folder called Assign 2C. Save the form and the project as  carroll_ics_assign2c_yourname.

  1. Using the following form as a guide, create a program to convert distance measurements between the imperial & metric systems. 


  1. Write a program that will prompt the user for a password and then displays a msg box congratulating them if they submitted the correct password or informing them that access is denied.

   

  1. Add a textbox, a label, and a command button to a form.
  2. Change the Caption property of the 1st label to Enter your Password:
  3. Delete the text from the Text property of the textbox.
  4. Change the Caption property of the command button to OK.
  5. Change the Name property of  the text box to txtPassword, and the command button to cmdOk.
  6. Double-click on the command button to enter code for the click event.
  7. If the user enters the correct password "joecool" then display a message box that congratulates them, otherwise display a message box that informs them that access is denied.

  8. You will need to use an If statement to determine if the user's password is correct or not.
  9. The code for the congratulatory message box is : MsgBox "Congratulations!", vbInformation, "Password Accepted"
  10. The code for the access denied message box is : MsgBox "Access Denied", vbCritical, "Password Rejected"
  11. To include additional functionality, make it so asterixes (****) appear in the text box instead of what the user actually types. To do this, assign the PasswordChar property of the text box to ASCII character 42. For example, txtPassword.PasswordChar = Chr(42) or while in break mode, simply select the text box and place an asterix (*) in the PasswordChar property of the text box.
  12. To include additional functionality, allow the user the option of changing their password.
  13. Create a new folder called Assign 2E
  14. Save the form and the project as carroll_ics_assign2e_yourname

Unless otherwise noted all programming assignments will be evaluated based on the following rubric.