• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month
Page
  1. 1
    1
  2. 2
    2
  3. 3
    3
  4. 4
    4
  5. 5
    5
  6. 6
    6
  7. 7
    7
  8. 8
    8
  9. 9
    9
  10. 10
    10
  11. 11
    11
  12. 12
    12
  13. 13
    13
  14. 14
    14
  15. 15
    15
  16. 16
    16
  17. 17
    17
  18. 18
    18
  19. 19
    19
  20. 20
    20
  21. 21
    21

Investigating Visual Programs

Extracts from this document...

Introduction

BTEC Visual Programming Unit 32 Title: Investigating Visual Programs Task 1 As you investigate the programs, List and explain the differences you find as you work in the environments. Explain the benefits of working in a visual environment instead of a non-visual environment? P6 Visual Basic Visual Basic is probably the most popular and powerful of all. It has many advanced features which allow you to write great programs in a short time with a minimum of code and sometimes no code at all from your part if you're to use the application wizard. QBasic QBasic (a name derived from QuickBASIC, BASIC being an acronym for Beginner's All-purpose Symbolic Instruction Code) is a variant of the BASIC programming language. The source code is compiled to an intermediate form within the integrated development environment (IDE), and this intermediate form is immediately interpreted on demand within the IDE. QBasic and VB are really just sets of commands to tell the computer what to do. There are significant differences between QBasic and VB. The first and most obvious difference between Qbasic and Visual basic is that a Qbasic is a dos program whereas VB (Visual Basic) is a windows program. That means that while they both have successful communities of enthusiastic a programmer, Qbasic is old. And while it is perfectly good as a programming language, the operating system that it works and compiles in is getting less and less compatible with modern computers. So while the programs it makes might be intrinsically flawless, they are not useful. On the other hand since VB is a newer programming language, it can be used to make programs that can be distributed and possibly sold because the programs it makes are compatible with modern computers. Even programs that are not so good can be useful if made by VB. A second difference is in the way the programs are and can be made. ...read more.

Middle

ball.Width > Me.Width Then 'sets goright equals to false goright = False 'sets goleft equals to true goleft = True End If 'looks if the ball is at the left side of the form If ball.Left < Me.Width - Me.Width Then 'sets goright equals to true goright = True 'sets goleft equals to false goleft = False End If End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 'looks if the left key is down If KeyCode = vbKeyLeft Then 'makes the paddle go 120 twips to the left (twip is vb's opposite to pixel but its not same size its much smaller) paddle.Left = paddle.Left - 120 'looks if the right key is down ElseIf KeyCode = vbKeyRight Then 'makes the paddle go 120 twips to the right paddle.Left = paddle.Left + 120 End If End Sub Private Sub Form_Load() 'sets godown equals to true godown = True 'sets goup equals to false goup = False 'sets goleft equals to true goleft = True 'sets goright equals to false goright = False 'sets lifes equals to 5 lifes = 5 End Sub Private Sub moveball_Timer() 'if goright equals to true then... If goright = True Then 'make the ball go right ball.Left = ball.Left + 40 'if goright equals to false then... ElseIf goright = False Then 'do nothing End If 'if goleft equals to true then... If goleft = True Then 'make the ball go left ball.Left = ball.Left - 40 'if goleft equals to false then... ElseIf goleft = False Then 'do nothing End If 'if goup equals to true then... If goup = True Then 'make the ball go up ball.Top = ball.Top - 40 'if goup equals to false then... ElseIf goup = False Then 'do nothing End If 'if godown equals to true then... If godown = True Then 'make the ball go down ball.Top = ball.Top + 40 'if godown equals to false then... ...read more.

Conclusion

Each Module provides a distinct purpose. I have identified the Modules below. * CMD_Click( ) * SWAP ( ) * COMPARE() CMD_Click( ) : If CMD(Index).Caption <> "" Then 'To check that block is not empty If selected block is not in first row: If Index > 3 Then If CMD(Index - 4).Caption = "" Then To check that empty block is in first row or not Call SWAP(Index, -4) 'if Ok Swap Call COMPARE 'To check all number are arranged or not Exit Sub End If End If If selected block is not in last row: If Index < 12 Then If CMD(Index + 4).Caption = "" Then 'To check that empty block is in first row or not Call SWAP(Index, 4) 'if Ok Swap Call COMPARE 'To check all number are arranged or not Exit Sub End If End If If selected block is not in last column: < If (Index + 1) Mod 4 <> 0 Then If CMD(Index + 1).Caption = "" Then 'To check that adjacent right block is empty Call SWAP(Index, 1) 'if Ok Swap Call COMPARE 'To check all number are arranged or not Exit Sub End If End If If selected block is not in first column: If Index Mod 4 <> 0 Then If CMD(Index - 1).Caption = "" Then 'To check that adjacent left block is empty Call SWAP(Index, -1) 'if Ok Swap Call COMPARE 'To check all number are arranged or not Exit Sub End If End If End If SWAP ( ): Module to swap selected number with empty block: TEMP = CMD(A).Caption CMD(A).Caption = CMD(A + B).Caption CMD(A + B).Caption = TEMP COMPARE(): 'Module to check that all number are arranged in 'order or not if so, Show win Screen For x = 0 To 14 If CMD(x).Caption = x + 1 Then flag = flag + 1 ElseIf CMD(x).Caption <> x + 1 Then flag = 0 Exit Sub End If If flag = 14 Then Load frmwin frmwin.Show End If Next x ?? ?? ?? ?? G:\Unit 32 Visual Programming\Assignment1\investigating visual programs.doc\Manmeet Singh (Kaur) ...read more.

The above preview is unformatted text

This student written piece of work is one of many that can be found in our AS and A Level Computer Science section.

Found what you're looking for?

  • Start learning 29% faster today
  • 150,000+ documents available
  • Just £6.99 a month

Not the one? Search for your essay title...
  • Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

See related essaysSee related essays

Related AS and A Level Computer Science essays

  1. Visual basic

    * Need for comments and naming conventions. Recommended Techniques to Minimize "Bugs" * Setting "Option Explicit" to force explicit declaration of variables * Commenting the code * Using the syntax checker * Using the recommended naming conventions * Setting a tight scope on the variables and procedures * Perform range

  2. Computing Project

    the text in edpasssword and place into the field called password in an access table ADOuandpsetup.post;//send the text Showmessage ('Your Username and Password has Been Saved');//showmessage username and password saved end; end; end. Adding a DVD to a Table procedure TFmAddNewDvd.BtnAddDvdsClick(Sender: TObject); var FmAddNewDvd: TFmAddNewDvd; DVDid:integer; Begin//begin if adofilms.recordcount=0 then//if

  1. Control Unit, Memory Unit, and Arithmetic Logic Unit. The CPU or Central Processing ...

    Notice that the question asked for three answers. The sensible response would seem to be to number them. The expected answers are the three single line responses. The contents of the brackets give extra information which would not be expected in this question. However, if the question had said 'Describe...'

  2. Explain sequence, selection and iteration as used in computer programming; outline the benefits of ...

    6. Num(1) = Console.ReadLine() 7. Num(2) = Num(0) + Num(1) 8. Console.WriteLine("These two numbers equal: " & Num(2)) 9. If Num(2) >= 1000 Then 10. Console.WriteLine("That's a big number!") 11. Else 12. Console.WriteLine("That is not a big number...") 13. End If 14. Console.ReadLine() As you can see, it is the same as my previous example, except several lines of code have been added post script.

  1. Programming Techniques

    Examples are number : integer; amount : real; status : Boolean; answer : character; Constants Any value that is required to be the same all the way through a program can be set up as a named constant. Reference can be made without the need to enter its value at many places.

  2. Explain sequence, selection and iteration as used in computer programming; outline the benefits of ...

    -2,147,483,648 to 2,147,483,647 Floating point / decimal integers, although requiring more reserved space in RAM than normal integers, can be more precise. They are called floating points because the decimal is not fixed, and can be moved around. (Wikipedia, 2011)

  1. Computers would not work the same without programs. The programs on computers were made ...

    There exists a relationship between the computer program and how a computer processes and stores data. The computer program carries a highly important job for the computer, which processes commands and gives a set of rules for the computer to follow.

  2. Computing Project

    There will also be a back up of the main system so if it happens to crash or is damaged then it can be replaced. If the system does crash then the files will have to be manually transferred back into the system from the backup.

  • Over 160,000 pieces
    of student written work
  • Annotated by
    experienced teachers
  • Ideas and feedback to
    improve your own work