Programming Methodology in Visual Basic

Views:
 
Category: Education
     
 

Presentation Description

No description available.

Comments

By: ROGERSSAT (12 month(s) ago)

no comment

Presentation Transcript

Programming Methodology : 

4/29/2009 1 Programming Methodology A lesson for class XI Prepared by – BIRBAL JAT PGT (Computer Sc.)

Introduction: : 

4/29/2009 2 Introduction: Computerized information systems are developed to provide computer solutions to user problems. If all the requirements of user are served by the computerized solution, the user is satisfied enough. Thus, the software should be designed effectively so as to meet its objective of user satisfaction. The software designing involves mainly two things – program structure and program representation. Program structure refers to how a program should be. Program representation refers to its presentation style so that the program becomes more readable and presentable.

GUIDELINES : 

4/29/2009 3 GUIDELINES Developing good programs is a skill and writing good program is a quality habit. This good habit can be developed by using the following guidelines :- 1. Follow Naming Conventions: It focus on a program's physical structure and appearance. It make the code easier to read, understand and maintain. For Example: use prefix to identify the type of object as Check box chk Command button cmd Text box txt

GUIDELINES …… : 

4/29/2009 4 GUIDELINES …… 2. Ensure Clarity of Expressions Expressions carry out the specified actions. Thus they must be clearly understood by the user. Avoid programming tricks whose intent (aim) will not be obvious to a reader. Use standard functions in expressions to enhance readability.

GUIDELINES …… : 

4/29/2009 5 GUIDELINES …… 3. Use Comments and Indentation Comments play a very important role as they provide internal documentation of a program. Indentation makes the statements clear and readable. In VB comments are given either by ‘(apostrophe) or REM keyword. For example : ‘ This is my first program in VB or REM This is my….. Dim X as integer Dim Y as integer

GUIDELINES …… : 

4/29/2009 6 GUIDELINES …… 4. Insert Blank Lines and Blank Spaces The insertion of blank lines and blank spaces at appropriate spaces also enhance the program readability. The blank lines are normally inserted before label, const, data type , variable declarations. The blank spaces may be added before operators like +,-,*,/ and characters like REM.

GUIDELINES …… : 

4/29/2009 7 GUIDELINES …… 5. Use of free formatting style Any number of statements can be written in one line using a statement separator, which is colon (:) in Visual Basic. For example : REM this is a program to print odd numbers from 100 to 1 DIM i As Integer : For i = 99 To 1 Step-1 Print i Next i When a program formatting is done to make a program more readable, it is called PRETTY PRINTING. FOR Example ………. DIM i As Integer For i = 99 To 1 Step-1 Print i Next i

Characteristics of a good program : 

4/29/2009 8 Characteristics of a good program Effective and efficient: The program produces correct results and is faster, taking into account the memory constraints. User friendly: The user should not be concerned about what is happening inside the program. The program should interact with user by understandable messages. The user should be only responsible for providing the input data values and rest everything should be the program’s responsibility. The output of the program should also be understandable.

Characteristics ................... : 

4/29/2009 9 Characteristics ................... 3. Self Documenting Code: A good program must have self-documenting code. The source code that uses meaningful names for variables and identifiers to clarify their meaning in the program, is called self documenting code. 4. Reliable: Means the program must be able to handle unexpected situations like wrong data or no data. The program should display proper error message. 5. Portable: The program should be portable i.e. it should be able to run on different platforms.

Program development steps : 

4/29/2009 10 Program development steps 1.Analyse the problem: This step involves understanding the problem and identifying minimum number of inputs required for output. 2. Plan an algorithm : In this step the step by step solution of the problem is planned. 3. Code programs: This step is to translate the algorithm into a programming language. 4. Test and debug programs: After coding the next step is to test and debug the program. Testing is the process of finding errors and debugging is the process of correcting errors found during the testing process. 5. Documentation and Maintaining programs: Documentation is extra information to enhance usability and readability of the program. Maintaining program involves modifying the programs to remove or to add some features to keep program up to date.

Type of Errors : 

4/29/2009 11 Type of Errors An error,sometimes called ‘a bug’, is

Assignments : 

4/29/2009 12 Assignments Define data types. What is Variable. How many data types are supported by VB? What is variant data types? What do you mean by variable life time. ?

Slide 13: 

4/29/2009 13 Thank you We will discuss about operators used in VB tomorrow. Have a nice day.