Unit-1 Java’s Lineage

By Haitomns G

Programming Concept

The term computer programming concept is defined as an entire series of steps involved in solving a problem on the computer. These steps involve defining exactly what is wanted, cleaning up all ambiguities of uncertainty present in the statement of the problem, and deciding how to solve it.

Let us consider an example to explain the concept of programming. Suppose you wish to buy a laptop, how do you go to buy it. First, we find the cost of the Laptop and store the information in small parts of our memory, lay A. Next you find the amount of money you have with you and store it in another part of memory, say B. A and B consists the input data required. for data processing. Processing is doing arithmetic calculations or logical comparisons. In this example, data is processed by checking whether the content of A is greater than, or less than, or equal to B. To buy a laptop A should be less than or equal to B. According to the processing, you decide whether to buy the laptop or not. The result of processing will be output. These steps involve processing which is known as the programming concept.

Characteristics of a good program

1) Reliability: The program should be able to function properly through its life cycle. It should be able to handle all range of values and all different types of data without crashing

2) Readability: The program should be written in such a that it is an easy way to read and understand. The program logic should be simple and should avoid unnecessary complications. Make sure that you see meaningful data names and add comments wherever possible. This increases the readability of the program’s proper indentation reflects the program.

3) Efficiency: It should be able to do its assigned task with minimum effort and maximum efficiency. Tricky Logic should be avoided as it creates complications and may in the long run.

4) Maintainability: A program should be written in such a way that it is easy to add, modify and delete steps in the program without affecting the whole program. To achieve this a program should be written in an organized manner.

5) Portability: One should be able to transfer programs in different operating system with minimum amount of modification. This can be achieved. by using standard feature of operating system and separate module in a program for dealing with data peripherals and processing.

6) Reusability: This is one of the best features of one find Object oriented programming. In object-oriented programming, data and function, which are small independent program. together into single unit called object that are member of class. A class serve as a or blue print for a plan object. Once a class is created it can be used by different program, this is called reusability.

Design Tools

There are three most popular design tools. used in design of solution.

  1. Flowchart
  2. Algorithm
  3. Pseudocode.

Flowchart

A flowchart is the pictorial representation of the step-by-step instruction of an algorithm It specify the solution procedure and other information required for the solution, procedure and function.

Flowchart are created by using the special geometrical symbols. Each symbol represents an operation. The symbol is joined by arrows to obtain a complete solution.

There are two types of flowcharts:

 • Program Flowchart

 • System Flowchart

(a) Program Flowchart: Program Flowchart represents pictorially the sequence of instruction for solving a problem.

(b) System Flowchart: System Flowchart indicates the flow of data into a data processing system, through the system and out of the system.

Symbols used in flowchart

flowchart
Flowchart Symbols

Draw a flowchart to find the sum of two numbers.

addtwonumbers
Flowchart to add two numbers

Advantages of Flowchart

• It forms a good visual aid to represent the logic for the problem solution.

• It is a form of program documentation.

• Flowchart help us to code the program efficiently.

• Maintenance becomes flowchart. easy with the help of flowchart.

Disadvantages of Flowchart

• It is not useful to represent complex programming logic.

• For any alternation (modify) the flowchart has to be redrawn completely.

 • We need a special program to draw and maintain flowchart digitally.

Rules for writing flowchart.

• Flowchart are drawn from top to bottom or left to right.

• A flowchart always being with START and ends with STOP Symbols.

• Flow lines are used to join symbols.

• For complex flowchart, covering than one page, to join them. more connector can be used to join them.

Algorithm

An algorithm is a step-by-step procedure to solve a given problem in a finite number of steps. The word algorithm is derived from the name of famous 8th century Persian mathematician Muhammad ibn Musal al-Khwarizmi.

Properties of Algorithm

• It must be simple.

• It must accept zero or more inputs.

•  It must involve a finite number of instructions.

• It must give the unique solution to the problem.

• It produces at least one output.

Algorithm Notation

1) Name

Specify the problem.

2) Step Number

Each Instruction is identified by a number called the number step.

3) Comments

 It describes the operation and is written within a pair of square brackets.

4) Beginning/Termination

It indicates start/Stop of the algorithm.

Write an algorithm to find the sum of two numbers.

Step 1: Start

Step 2: Input A and B

Step 3: [Calculate the sum].

             Sum = A+B

step 4: Output Sum

Step 5: Stop

Advantages of Algorithm.

• It is step by step solution which is easily understood since it is written in English language.

• It consists finite number of steps to arrive at solutions.

• It is independent of any programming language so that the user need mat Known the syntax of programming language to develop the logic.

• Algorithm makes program makes maintenance easier.

Disadvantages of algorithm.

• Developing the algorithm for large and complex problem would be time consuming and difficult to understand.

• Understanding complex logic through algorithm would be difficult.

Pseudo code

Pseudo Code is a simple way of writing programming code in an English. Pseudo code is not actual Programming Language. It uses short phrase to write cade for program before we actually create Pseudo code make creating program easier.

Pseudo code should begin with word START and Finish with word STOP, while developing a pseudo code various convention called primitives are followed.

These conventions are;

1) Initialize the variables, which means. settings the value. of variable to sum value, so that if any junk value is stored in it, it is clear from the memory.

2) To read or accept input and write of display output you have to simplify read values and write value.

Write a Pseudo code sum of 2 numbers.

START

Number A, B and Sum

Output (“Input m1 and 12”).

Input A, B

Sum = A +B

Output Sum

END

New Programming Paradigm

A programming paradigm is a fundamental style of a computer programming style of a computer programming, serving a way of a building of a structure and element of computer programs. A new programming paradigm which can be useful, in a particular for implementing windows interface parallel algorithms.

Differences between Object Oriented and Event Driven Programming.

Object orient Programming focus on performing action and manipulation of data i.e., encapsulated in an object within the sequential series of steps.

OOPS, is a programming language where we can create our own class but with event driven, we can only use the already use class.

Event driven means everything happens from an event (like mouse-click or Key pressed) and an object oriented interacts with an object.

Event driver is more dynamic. Event driven programs can have threads. to perform action based upon triggers/event in our program.

Also, Read

  1. Unit-1 Introduction to Mobile Application
  2. Unit 2 Mobile Operating System
  3. Engineering Drawing Notes
  4. Computer Networking Notes

Haitomns G. is a desktop, android, and web developer based in Nepal. He has worked on building several websites, apps, and softwares for clients and independent projects. He is experienced in C, C++, C#, Java, Python, SQL, HTML, CSS, PHP, and JavaScript.

Leave a Comment

Slide to prove you're not a bot/spammer *