visual basic

posted by .

(1) state the condition under which a FOR-TO-NEXT loop will not be executed.

(2) With the aid of illustrative example, describe how a subroutine is implemented in BASIC.

  • visual basic -

    You have not specified whether it is Visual Basic 6 or VB.net. In this case, the answers don't make a difference, but the versions will help to give a better context.

    1. The format of the for-next loop statement is:
    FOR i = start TO finish, [STEP s]
    ... statements to be executed
    NEXT

    On entering the loop, if the initial value of finish is greater than start, the statements inside the loop will not be executed at all.
    However, if s is specified and is negative, the loop content will not be executed if start is less than finish.

    Examples where the loop will not execute are:
    FOR i=10 TO -1.... next
    FOR k=1 TO 10 STEP -5... next


    2. Example:
    Here is an actual example from VB.net

    Sub keypressed(ByVal o As [Object], ByVal e As KeyPressEventArgs)
    If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Or Char.IsDigit(e.KeyChar) Or e.KeyChar = Microsoft.VisualBasic.ChrW(7) Then
    e.Handled = True
    End If
    End Sub 'keypressed

    You can modify it according to your requirements for describing how subroutines are implemented.

    For a VB6 tutorial:
    http://www.vbtutor.net/vbtutor.html

    For a VB.net tutorial:
    http://www.homeandlearn.co.uk/NET/vbNET.html

  • visual basic -

    CIT201: Programming



    Assignment 2


    --------------------------------------------------------------------------------

    Entering Code in Visual Basic

    In this assignment, you will finish the project you began last week. Open the Smith Repair Parts Specials program interface.







    Code the Project

    The description and price of a repair part or service should display to the two TextBox controls with the ReadOnly property = True because the TextBox controls on this form are used for output, not input.



    Three Display Buttons: when a button is clicked, the relevant information should display on the form.



    The data to be displayed for each of these three buttons are given in the table shown below.



    Button
    Repair Specials Information
    Price

    Auto
    New Brakes and Calipers
    $129.95

    Truck
    Heavy Duty Tires
    $185.50

    Commercial
    Annual Inspections
    $82.49




    Include the following:

    1. When designing the form, select control names that follow the naming convention specified in the lecture.

    2. Include comments before the Public Class declaration that include the PROJECT, PROGRAMMER NAME, and DATE.

    3. Include remarks statements inside of each sub procedure to identify what the sub procedure does.



    Zip the files and upload into the appropriate dropbox.



    This activity will be graded using the Technology Application Grading Rubric - Programming.



    Learning Outcome(s): 4

    4. Design a program interface and determine the appropriate controls and code.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. visual basic 6

    1)with the aid of illustrative examples, differentiate between Input statement and Read and Data statement.
  2. visual basic

    in visual basic, notes in a program which explain what the program is doing are called?
  3. visual basic

    in visual basic, a routine that puts a series of strings or numbers in order are called?
  4. visual basic (answer: comments)

    Hi Jon! Isn't Remarks the correct term for comments?
  5. Psychology

    Need help double checking these tricky psychology questions. I put an asterix (*)next to my answers, Thanks! Which of the following fields is the best example of psychology as a basic science?
  6. Psychology

    Need help double checking these tricky psychology questions. I put an asterix (*)next to my answers, Thanks! Which of the following fields is the best example of psychology as a basic science?
  7. Programming (Visual Basic)

    Im seem to be having trouble with this Exercise. Would you mind helping me please?
  8. life orientation

    Basic condition of employment act traffic control. What according to the basic condition of employment act applies with regard to the contravention that I've identified?
  9. VISUAL BASIC PROGRAMMING

    3. WRITE A VISUAL BASIC PROGRAM TO CALCULATE THE SIMPLE INTEREST ON A LOAN AMONUT OF 50000 GHANA CEDIS AT AN INTEREST RATE OF 30% FOR A NUMBER OF YEARS WHICH WILL BE SPECIFIED BY THE USER.
  10. visual basic

    Write a visual basic program to calculate total pay of employee who get an additional pay of 10% to their basic salary if they worked for more than 10years for the company

More Similar Questions