Feeds:
Posts
Comments

William Wang

Name: William

Likes:

interesting Television shows

animals eg. Cats and dogs

Cars

food

magazines

dislikes:

Anything that i have to pay for

anything that is tedious

rodents

ERRORS

What is Debugging ?

Debugging is the process of locating and removing any bugs that has infected the computer software in any ways.

For each of the other following, define the  term and give example:

1. syntax error

A syntax error is an error that occurs whens an user inputs words in an order which the program does not understand.

Example:

An example of a Syntax error could be when you mistyped or rearranged the URL when sufing the web, so web brower cannot find site

2. logical error

A logical error is a bug in a program thats causes it to operate incorrecly, but not fail.It will just provide wrong data.

Example:

An example of a Logical error is when you mistype a code in visual basic.When you run your code, you don’t get the result you think you’d get.

3. runtime error

A runtime error occurs during the operation of a computer program, it targets the duration of the program, from the beginning to termination.

 Example:

An example of a runtime error is when your program is running out of memory because it has just processed too much information, or information in a short period

Linguistic Diversity

  1. List as many different programming languages that you can find out about. Give descriptions of 3 of them and how they are unique.
    List of different programming languages ( taken from wikipedia).

    Array languages 
    Aspect-oriented languages ,
    Assembly languages, 
    Authoring languages
    ,
    Command line interface languages,
    Compiled languages ,
    Concurrent languages, 
    Curly-bracket languages
    , 
    Dataflowlanguage
    , 
    Data-oriented language
    ,
    Data-structured languages 
    Declarative languages

     Esoteric languages
    Extension languages
    Fourth-generation languages
    Functional languages
    Interactive mode languages
    Interpreted languages
    Iterative languages
    List-based languages – LISPs

    Visual Languages – they  let users specify programs in a two-(or more)-dimensional way, instead of as one-dimensional text strings, via graphic layouts of various types.  This way of programming is unique in comparison to others, due to the fact it actually allows users to visualiase what they are going to program, as in comparison to using a text language, where everything must be read.

Non-English progamming- are computer programming languages that, unlike most well-known programming languages, do not use keywords taken from, or inspired by, the English language. The thing which makes this so unique, is that it allows the program to access other languages and involve them into a program, which in effect if used to program something like a computergame, can be used for other countries.

Logic-Based Programming – specify a set of attributes that a solution must have, rather than a set of steps to obtain a solution. This way of programming is unique, as it saves time incomparison to programming a set of steps for a solution.

2. What do the terms procedural and object-oriented mean when referring to programming languages? The terms procdural programming language means thatwhen programming the program is composed of one or more units or modules, either user coded or provided in a code library; each module is composed of one or more procedures, also called a function, routine, subroutine, or method, depending on the language used. Basically the program is programmed through the use of codes and procedures in the form of a function/routine/method/subroutine.

The term object-oriented class-based programming means that it a program which supports objects which are defined by the class. Class definitions include member data. Polymorphic functions parameterized by the class of some of their arguments are typically called methods.bernardiscool

Dec 7 Q4: Documentation

h1

Dec 7 Q4: Documentation

December 6, 2007

  1. What is intrinsic documentation?
  2. In programming, what are comments? What is their purpose?
  3. Write up a list of pros and cons for writing documentation for computer programs.

Intrinsic documentation is a form of denotion that is crucial for a code to work, whether it be commas, numbers, capital letters or symbols. They highlight and pin point the error in a program without having any effect on it.

Comments on the other hand are used sparingly as they denote a code of its uses and its purpose. They are usually to remind the programmer of what he or she was doing beforehand. Comments have no effect on the program whatsoever and can only be seen internally. Comments have 4 categories :

  • Full-line comments
  • End-of-line comments
  • Block or multiple-line comments
  • Mega-comments
  • PROS AND CONS OF COMMENTS:

    PROS:

    They can easily explain or remind the programmer of the codes purpose

    They are great for revision

    The comments do not interfere with the actual program

    They are helpful when trying to understand complex pieces of information

    CONS:

     They are time consuming

    They are a waste of space

    Not everyone needs them

    QUESTION 1: GUIS

    1.What is a GUI?  What alternatives are there to GUIs

    GUI stands for “Graphical User Interface”.  GUI is a program that lets you use images and symbols rather then just words on a computer or a computer controlled device. Another alternative to a GUI is the use of a ” textual  interface” , where instead of generating graphical images, it is represented by text (words).

    2.What advantages do GUI bring?

    GUI is a great advantage to all users. For example, the “Graphical User Interface” makes it easier to move data from one application to another. The GUI makes the computer operation much more lively and beneficial for users. Because the GUI provides graphics in the computer system, it appeals to users more, so whatever is shown could be interpret easily and more widely used. The GUI enhances the efficiency of application programming.

    3.Name and explain some of the objects avaliable to programmers in GUI environment.

    • scroll bars- allow users to scroll down the page to view text/images etc
    • buttons – allow users to access differnt areas
    • text box – allow users to input text information
    • widget- allow users to upload videos on sites such as myspace/face book etc//

    Operators-Lily

    Dec 3 Q3: Data Operators

    December 2, 2007 For each of the following, describe its function, give an example of one and explain how it might be used in a program.

    1. Relational operators
    2. Logical operators
    3. Arithmetic operators

    Relational operator: numerical qualities are one example as they link the relation between 2 entries or values. Some examples are equalities (eg. 5 = 5) and inequalities (eg 4 ≥ 2). The operators predominantly return as true or false, this value relies mainly on the condition that has been set out or not. Relational operator is not limited to mathematics and is also used on computing. Instead of numerical values, they use programming language. Some examples of the use of relational operators are in relating one thing to another (substitution eg x + y = c; print c) 

    if (x < y) {
    printf("x is less than y in this example\n");

    Some examples of the uses include of 6 different tests:

    1. Testing the equivalence of 2 values ( exp1 = exp2 )
    2. To test the expression on the left is greater than or equal to the expression on the left ( exp1 >= exp2  )
    3. To test if the expression on the left is less than the expression on the right

     ( exp1 < exp2 )

    1. To test if the expression on the right is greater than the expression on the right (exp1 > exp2 )
    2. To test if the expression on the right is less than or equal to the expression on the  left  ( exp1 <= exp2  )
    3. To test if the expression on the left is not equal to the expression on the right ( exp1 != exp2 )

      

    As stated before, the final answer can only be true of false.

     Logical operators:   Logical operators work to test the falsehood of a pair of expression and if both expression are found correct, they evaluates to 1. Logical expressions are used alongside an “if” statement. But if either statements do not evaluate or are invalid, then the command is bypassed and results in 0. But if this is used incorrectly, then the program could be a source of bugs. The logical negation operator only takes one operand. An operand is “In computer programming, an operand is a term used to describe any object that is capable of being manipulated.” – www.computerhope.com/jargon/o/operand.htm 

    The operand works from left to right. Some expressions are:

    exp1 && exp2       Logical AND 

    exp1 || exp2        Logical OR 

    !exp1             Logical NOT 

    Arithmetic Operators: Arithmetic operators run simply on the basics of to add, to subtract, to divide, to negate or to simply find a value. The expression is written in numeric values and thus the answer is written in numeric value. The basics of arithmetic operations are:  

    + -                                This is a unary arithmetic symbol (unary: denotes if the value of the integer is positive or negative.)  it is also to add or subtract two values and also serve binary purposes.

    * /                                These symbols divide or multiply two values, these serve binary purposes.

    Errors

    1. What is debugging?
      Debugging is the process which removes ‘bugs’ or defects in the code or programing of a computer program or piece of electronic hardware. Debugging’s purpose is to hopefully make the program behave as expected with no errors.

    For each of the following, define the term and give an example.

    1. Syntax error: A syntax error refers to an error in the structure of the code. If you type the code in the wrong sequence, the computer will not be able to understand it, and so a syntax error is formed.
      EXAMPLE: On a calculator, a syntax error is formed when you open a brackets and you don’t close them, or when you put more then one decimal point in one number.
    2. Logical error: A logic error is an error that causes the program to operate incorrectly. The program is still able to run, it is just not able to produce the right answers.
      EXAMPLE: A wrong or incorrect formula is written.
    1. Runtime error: A runtime error is essentially an error that occurs when the computer is running the program. These errors can be caused by a software issue, a computer virus, conflict-ion with TSR or another running program, or memory issues.
      EXAMPLE: Computer viruses causes runtime errors by tampering with memory or the system settings.
    1. In our computers, we use and talk about files all the time. But what is a file? Write a technical definition of a computer file.

    A computer file is a named collection of information stored on a disk. Application programs and documents are examples of files. You are able to make a file when you create information (such as text or graphics) using a program, give the creation a name and save it on a disk.

         2.    What is an array? Find out how to access data that is stored in an array.

    An array is a type of data structure consisting of a group of elements that are accessed by indexing. Some programming languages support the array data structure which generalises operations and functions to work transparently over arrays as they do with scalars or other data structures.

    Data Types

    1.Definition of Data Types:

    Characters: Characters are a data type which provides a visual representation on the computer of printable characters. They can letters, numbers and other symbols

    Integers: This data type is used to represent whole numbers without fractional parts.

    Floating point numbers: Floating point numbers are used to represent numbers in scientific notation.3 × 10-5

    Strings: Strings are represented with both letters of the aplhabet and numbers.

    Booleans: Booleans are a data type which can have two values, true or false.

    Examples of these Data Types:

    characters: a, b, . , : !

    integers: 1 2 3

    floating point numbers: 3 × 10-5

    boolean: Visual basic

    Strings: a12r

    2. Other examples:

    string, number, boolean, object, movieclip, function, null, and undefined.

    Control Structures

    h1

    Dec 3 Q5: Control Structures

    December 2, 2007

    1. What is the purpose of a control structure?
      The Purpose of a control structure is to when a program does not follow the linear sequence of instructions, and it does things like repeat codes and take decisions, a control structure is what is used to specify the instructions that will be carried ot during that proccess.

    For each of the following, describe what exactly happens and give an example from real life.

    1. Sequencing control structure

    Sequence control refers to the user actions and computer logic which initiate, interrupt, or terminate transactions. Sequence control governs the transition from one transaction to the next. One example of this in real life is a lollipop man on a busy road who is able to stop the traffic flow, slow down the trraffic flow and allow cars to go through.

     

    2. Selection control structure
    In Selection structures, you are able to make one or two-way decisions with an “ if ” statement, and you can move through multiple possible paths by using a switch statement. Your decisions are either based on the relationship between values, with the relational operators, or you can make decisions based on the value of a simple data variable. One example of this in real life are cars on a road. If i car reaches two roads, one which is bunmpy , the other which is smooth, depending on the car’s situation,  If it is good condition it will go on the rough road, if it is not, it will go on smooth.

    3.Repetition control structure

    In Repetition control structures, the path of the program repeats and repeats until a certain condition is met, for instance, at lunch bernard ate corn. Bernard would keep biting,chewing  and then swallowing until the condition of “no corn left” is met.

    Older Posts »

    Follow

    Get every new post delivered to your Inbox.