Structure of Programming Languages Module 2 Read Only
This document discusses various programming paradigms and considerations for structured programming. It describes programming paradigms as fundamental styles of programming that differ in concepts and abstractions used. Specific paradigms mentioned include unstructured, modular, object-oriented, visual, and internet-based programming. It also discusses hardware and software considerations for structured programming, including the interaction of hardware components during program execution. Finally, it covers factors to consider when choosing a programming language and the key aspects of program development and design.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
22 views
Structure of Programming Languages Module 2 Read Only
This document discusses various programming paradigms and considerations for structured programming. It describes programming paradigms as fundamental styles of programming that differ in concepts and abstractions used. Specific paradigms mentioned include unstructured, modular, object-oriented, visual, and internet-based programming. It also discusses hardware and software considerations for structured programming, including the interaction of hardware components during program execution. Finally, it covers factors to consider when choosing a programming language and the key aspects of program development and design.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47
Content, Programming Paradigms,
Hardware and Software
Considerations for MODULE 2 Programming Paradigms 1 A PROGRAM PARADIGM IS A FUNDAMENTAL STYLE OF COMPUTER PROGRAMMING.
A METHODOLOGY IS A STYLE OF SOLVING SPECIFIC
SOFTWARE ENGINEERING PROBLEMS.
PARADIGMS DIFFER IN THE CONCEPTS AND
ABSTRACTIONS USED TO REPRESENT THE ELEMENTS OF A PROGRAM AND THE STEPS THAT COMPOSE THE COMPUTATIONS. Some example of programming paradigms include: • Unstructured programming • Modular/Structured programming • Object- oriented programming • Visual programming • Internet based programming Unstructured programming THIS IS A PROGRAMMING TECHNIQUE IN WHICH STATEMENTS ARE WRITTEN, ORDERED AND EXECUTED SEQUENTIALLY FROM THE FIRST TO THE LAST IN THE ORDER THEY APPEAR ON THE EDITOR.
IT ’S ALSO CALLED NON-STRUCTURED OR MONOLITHIC
PROGRAMMING.
IT IS HISTORICALLY THE EARLIEST PROGRAMMING
PARADIGM. Modular/Structured programming THIS IS A PROGRAMMING TECHNIQUE THAT ENABLES LARGE PROGRAMS TO BE BROKEN DOWN INTO MODULES THAT PERFORM A PARTICULAR TASK USING SIMPLE CONTROL STRUCTURES IN PROBLEM SOLVING, AND THEN THESE MODULES ARE INCORPORATED INTO THE MAIN PROGRAM THROUGH INTERFACES. Object- oriented programming OBJECT ORIENTED PROGRAMMING IS A PROCESS BY WHICH A PROGRAM IS ORGANIZED INTO OBJECTS WITH EACH OBJECT CONTAINING BOTH THE DATA AND THE PROCESSING OPERATIONS NECESSARY TO PERFORM A TASK. The structure, or building blocks, of object-oriented programming include the following: Classes • Are user defined data types that act as the blueprint for individual objects, attributes and methods. Objects • are instances of a class created with specifically defined data. Objects can correspond to real-world objects or an abstract entity. When class is defined initially, the description is the only object that is defined. Methods • are functions that are defined inside a class that describe the behaviors of an object. Each method contained in class definitions starts with a reference to an instance object. Additionally, the subroutines contained in an object are called instance methods. Programmers use methods for reusability or keeping functionality encapsulated inside one object at a time. Attributes • are defined in the class template and represent the state of an object. Objects will have data stored in the attributes field. Class attributes belong to the class itself. Visual programming THIS IS AN EVENT DRIVEN STYLE IN WINDOWS THAT IS BASED ON READYMADE OBJECTS WHICH COMPRISES OF A COLLECTION OF PROCEDURES THAT RESPONDS TO OTHER PROCEDURES THAT PERFORMS SPECIFIC TASKS. There are n numbers of visual programming languages and the few which are in the top list is given below • Scratch: With the help of this language users can create, stories, games, and animations without writing any lines of code in this you just have to create the logic and assemble the blocks. • Blockly: Used to create block-based programming language and editors, and also to generate code from blocks to javascript lua dart python and PHP, etc. • mBlock language: It is used in programming robots. • Bubble language: It is used to create web applications. • Minibloq language: It is used as a graphical programming environment for Arduino. Internet based programming THIS IS A PROGRAMMING PARADIGM THAT ENTAILS THE PROCESS OF DESIGNING WEBSITES AND WEB PAGES THAT ARE PART OF PARCEL OF THE INTERNET.
IN THIS CASE, VARIOUS PROGRAMMING LANGUAGES
ARE USED TO DESIGN BOTH THE CLIENT-SIDE AND THE SERVER-SIDE INTERFACES. Hardware and Software Considerations for Structured Programming • Hardware - is the equipment used to in performing the necessary functions during programming and in the execution of programs. • Software - consists of the programs that enable us to solve problems with a computer by providing it with lists of instructions to perform. The various hardware components interact as follows during program execution: • The program must first be transferred from secondary storage to main memory before it can be executed. • Normally the person using a program (the program user) must supply some data to be processed. • These data are entered through an input device and are stored in the computer’s main memory, where they can be accessed and manipulated by the central processing unit. • The results of this manipulation are then stored back in main memory. • Finally, the information in main memory can be displayed through an output device. The various hardware components interact as follows during program execution: • Processor Speed • Memory Capacity • Warranty • Cost • Upgradeability • Compatibility • Portability • Users’ needs Software is generally classified as: • System software – set of programs that are used to manage computer resources and it’s composed of Operating System, Network software, Utility software and Firmware • Application Software – this is a set of programs that are used by a computer user or programmer to perform certain tasks with the computer. These programs are categorized as follows depending on the task they perform: Programming languages, Tailor made software and Vendor-off-the-shelf software. So, the factors to be considered in choosing a programming language are: • Programmer’s experience • The nature of the application being developed • User friendliness. • Features of the language. • Programming paradigms it supports • Reliability So, the factors to be considered in choosing a programming language are: • Compatibility • System requirements • Upgradeability • Documentation • Security • Cost Program Development and Design CONTENT • Meaning of Program development and design • Program development Life cycle: 1. Problem recognition 2. Problem definition Meaning of Program Development and Design Development Development is the act of improving by expanding or enlarging or refining Program development is an ongoing systematic process that programmers follow as they try to come up with sets of instructions that can be executed by a computer to solve some of the complex problems that human beings would either take too long to solve manually, or they would not be able to solve at all. In fact, the four main activities involved in programming are: 1. Designing and testing an algorithm as a solution to a problem. 2. Calling algorithm into a computer program using appropriate language. 3. Testing the computer program to find out whether it solves the problem 4. Documenting the computer program so that it can be maintained by others at a later date. The main functions of a computer program are to process data into information. A computer program therefore performs the following activities: 1. Accepts data from outside the computer as input 2. Carries out a set of processes on the data within the computer memory . 3. Stores the data for future use 4. Presents the results of this processing as its output In order to come up with a solution to a problem we must: 1. Have a clear understanding of the problem 2. Determine what we need to help solve the problem 3. Decide what results we want to achieve 4. Consider different ways to achieve our result and select the best one 5. Then we must come up with a step-by-step sequence of instructions to be followed to achieve a solution o the problem Therefore, during the process of developing the program, one should ensure that the correct requirements are identified at each stage before the next stage is initiated. Otherwise, the method of developing the program may be very expensive. Program design THIS IS THE ACTUAL DEVELOPMENT OF THE PROGRAM'S PROCESSING OR PROBLEM SOLVING LOGIC CALLED THE ALGORITHM THAT ENABLES THE PROGRAMMER TO COME UP WITH MODELS OF THE EXPECTED PROGRAM. THE MODELS SHOW THE FLOW OF EVENTS AND DATA THROUGHOUT THE ENTIRE PROGRAM FROM THE TIME THE DATA IS INPUT TO THE TIME THE PROGRAM GIVES OUT THE EXPECTED INFORMATION. Therefore, program design involves developing the method of solving the problem by planning and creating a solution using structured programming techniques such as top-down program design, pseudo code, flowcharts, control structures, decision tables and decision trees. In program design, the programmer identifies the processing tasks required, and the precise órder in which they are to be which the computer carried out, that is an algorithm from which the computer program will be produced In order to come up with a solution to a problem we must: Algorithm - is a sequence of instructions which, if followed, produces a solution to the given problem and is written using special rules and statements. Pseudo Code - processing steps of a program or module. Module - is a portion of the main program containing a group of processing instructions performing a specific task. Modular Programming - Modular programming involves developing program informs of modules making it to be flexible, easier to read and correct errors. In order to come up with a solution to a problem we must: Flowchart - is a graphical representation of the steps needed to solve the problem by using special symbols that have specific meaning and short statements. Control Structures - are blocks of statements that determine the order of execution of statements in a program A detailed design must define the following: 1. Data structures - defining the format and type of data the program will use. 2. User interface- the design of the screen the user will see and use to enter data or display data 3. Inputs - defining the kind of data to enter into the program. 4. Outputs - the possible data displayçd from the system 5. Algorithms methods of calculating outputs depending on inputs. Programming Developnent Life Cycle (PDLC) THIS IS A RECOMMENDED SERIES OF STEPS THAT ARE SUPPOSED TO BE FOLLOWED WHEN DEVELOPING A PROGRAM. THEREFORE, BEFORE COMMITTING ONESELF INTO WRITING A PROGRAM, THE FOLLOWING ARE THE STEPS THAT MUST BE FOLLOWED AND THEY FORM A PROGRAM DEVELOPMENT LIFECYCLE (PDLC): Therefore, in order to develop a program that can adequately solve the problem at hand, a programmer has to: 1. Specify the problem requirements. 2. Analyze the problem. 3. Design the algorithm to solve the problem. 4. Implement the algorithm. 5. Test and verify the completed program. 6. Maintain and update the program. Specifying the problem requirements • Specifying the problem requirements forces you to state the problem clearly and unambiguously and to gain a clear a understanding of what is required for its solution. • Your objective is to eliminate unimportant aspects and zero in on the root problem. • This goal may not be as easy to achieve as it sounds. You may find you need more information from the person who posed the Analyze the problem • Inputs, that is, the data you have to work with • Outputs, that is, the desired results • Any additional requirements or constraints on the solution. Design the algorithm to solve the problem • Designing the algorithm to solve the problem requires you to develop a list of steps called an algorithm to solve the problem and to then verify that the algorithm solves the problem as intended. • Writing the algorithm is often the most difficult part of the problem- solving process. NOTE: Don't attempt to solve every detail of the problem at the beginning: instead, discipline yourself to use top-down design. In top-down design (also called divide and conquer). you first list the major steps, or sub problems, that need to be solved. Then you solve the original problem by solving each of its sub problems Implement the algorithm • Implementing the algorithm (step 4 in the software development method) involves writing it as a program. • You must convert each algorithm step into one or more statements in a programming language. Test and verify the completed program. • Testing and verifying the program requires testing the completed program to verify that it works as desired. • Don't rely on just one test case. • Run the program several times using different sets of data to make sure that it works correctly for every situation provided for in the algorithm. Maintain and update the program. • Maintaining and updating the program involves modifying a program to remove previously undetected errors and to keep it up- to-date as government regulations or company policies change. • Many organizations maintain a program for five years or more, often after the programmers who originally coded it have left or moved on to other positions, NOTE: A disciplined approach is essential if you want to create programs that are easy to read, understand, and maintain.