Home UP BOARD Question Papers NCERT Solutions CBSE Papers CBSE Notes NCERT Books Motivational

ip notes for Class 11 Programming Guidelines Download PDF

Ip Notes For Class 11 Chapter 7 Programming Guidelines Download PDF

Chapter : 7 Programming Guidelines

NCERT Notes For Class 11 I.P.

Chapter : 7 Programming Guidelines

GUI application development guidelines:

GUI Programming adopts simplified approach to programming. In GUI Programming, most of the components are predefined in a generic way to be adapted and incorporated according to the needs of the application.

Some guidelines for good GUI Programming are:

• Understand the need of the application beforestarting the development.
• Find out all possible inputs, which arerequired to produce the desired result/output.
• Avoid ambiguity and use appropriate input component.
• Provide appropriatelabels for each input and output options.
• Use meaningful names for variable, controls etc. and follow naming conventions.
• Ensure clarety of expression so user can easly understand it.
• Use comments and proper indentation.
• Insert blank lines and blank spaces wherenecessary to separate logical group of statements.
• Avoid using free formatting style.

Characteristic for a Good Program

• Effective and efficient
• User friendly
• Self documenting code
• Reliable
• Portable

Stages of Program Development Process

Program/application development is a step by step process. Effective and efficient software is developed only throuth systematic apporach.

Stages of the application development are:

Phase 1: Analysis : This phase contains following steps:

• Problem Specification: To understand the problem and set the objective.
• Requirement Analysis: To find the technical, financial, and operational requirement for the new application.
• Possible Input and Output for obtaining desired results.

Phase 2: Designing : In this phase detailed design of the following components is to be made:

• Input Design
• Ouput Design
• Interface Designing (Forms)
• Modular Components
• Algorithms

Phase 3: Coding
Phase 4: Testing and Debugging:
Phase 5: Implementation
Phase 6: Documentation and M aintenance:

Types of Errors

Compile Time Error- Occurs during compile time. When a program compiles it sources code is checked for rules of programming language. Its types are:-

Syntax error: it occurs when a grammatical rule of Java is violated
Semantic error: it occurs when statement are not meaningful.
Run Time Error: Occurs during the execution of the program.
Logical Error: Occurs due to wrong logic of a program.

Questions & Answers on Programming Guidelines

Q1. Excessive comments add time to the execution of your program. (True/False). Justify your answer.

Ans. No, Comments don’t add time to program execution. As comments are only for documentation purpose. They are non executable statements.

Q2. Differentiate between compile time and run time errors.

Ans: a. Compile time errors occur due violation of grammatical rules of a programming language. Run time errors occur during execution of program.

Compile time errors are easy to correct as we get error message corresponding to that which give an idea to correct it. Run time errors causes abnormal termination of program.

Example of compile time error: Missing semicolon(;). Example of run time error: Divide by zero error, Logarithm of a negative number.

Q3. Which error is harder to locate and why?
Ans: Logical errors are harder to locate. Logical errors occur due to error in the logic of a program. When a program is syntactically coorect, even running properly but not giving a desired output, it means that it has a logical error.

One common example of logical error is when we write a statement
(Eng+Math+Sci/3) instead of (Eng+Math+Sci)/3 to calculate average of marks of 3 subjects.

Q4. Explain the term ‘Exception Handling’.
Ans. A run time error is called an exception , which causes abnormal termination of program. To handle such type of errors/exception is called Exception handling.

In java exception handling is done by try{ } and catch { } block. Statements that can raise exception are put in try{ } block and its handling code is written in catch { } block.

Q5. Define Syntax :
Ans. Syntax: Formal set of rules defined for writing any statement in a language is known as syntax. Example- Every line in JAVA should be terminated by semicolon(;).

Q6. Define Protability.
Ans. Portability -Portability means an application should run on different platform without doing any changes.

Q7. Prettyprinting
Ans. Prettyprinting is the formatting of a program to make it more readable. These formatting conventions usually consist of changes in positioning, spacing, color, contrast, size and similar modifications intended to make the content easier to view, read and understand.

Q8 The code given below will give an error on execution if the value entered in t2 is 0. Identify the type of the error and modify the code to handle such an error.
int a,b,c;
a= Intger.parseInt(t1.getText());
b= Intger.parseInt(t2.getText());
c= a / b;
Ans: The error is logical error. int a,b,c;
a= Intger.parseInt(t1.getText());
b= Intger.parseInt(t2.getText()); if(b!=0)
c= a / b;
else {
JOptionPane.showMessageDialog(null,”Denominator cann’t be zero”);
t2. setText(“ “);
t2.requestFocus( ) ;

Q9. What are the characteristics of a good program?
Ans. The characteristics of a good program are-

• The program should be efficient in terms of execution speed and effective memory utilization.
• Code should be accurate. It should produce correct result.
• The program should user friendly. It means meaningful names should be given to variable, proper messages should be given, use of comments and indentation.
• The program must be reliable that is it should be able to handle the situation when the wrong inputs are given.
• The program should be portable so that it can run on different platforms without doing any changes.

Q10. What is the use of comments and indentation?
Ans. Comments are non executable statements and are used for internal documentation purpose. In Java comments are given either by // or /* ….*/ brackets.
/* This method calculates sum of two numbers.*/
int Sum( int x, int y) // x,y are formal parameters
return (x+y);
Indentation makes a program readable and understandable. When you are writing a program you must remember that the opening braces should properly match with a closing braces. Spaces should be inserted between operator and operands in an expression.

Programming Guidelines Download PDF

Please send your queries to ncerthelp@gmail.com you can aslo visit our facebook page to get quick help. Link of our facebook page is given in sidebar

Class and Subject List

Ncert Solution for class 6 to 12 download in pdf

CBSE Model test papars Download in pdf

NCERT Books Free Pdf Download for Class 5, 6, 7, 8, 9, 10 , 11, 12 Hindi and English Medium

Mathematics Biology Psychology
Chemistry English Economics
Sociology Hindi Business Studies
Geography Science Political Science
Statistics Physics Accountancy

CBSE Syllabus Class 6 to 9, 10, 11, 12 Maths, Science, Hindi, English ...

Last year CBSE Question paper for Class 6 to 9, 10, 11, 12 Maths, Science, Hindi, English ...

Important Links

Follow Us On

Face book page ncerthelp twitter page youtube page linkdin page



Please Share this webpage on facebook, whatsapp, linkdin and twitter.

Facebook Twitter whatsapp Linkdin

Copyright @ ncerthelp.com A free educational website for CBSE, ICSE and UP board.