Friday, November 3, 2017

How to work on office data base



*Open Office Database

*Overview

*Planning a Database

*A Database Design Checklist

*Database Objects/ Elements

*Working with Database Objects

*Macros and Modules

*Overview

*The database engine:

– Is the (generally invisible) software that actually stores, indexes, and retrieves data. When you create a standalone database, Open Office Base /Access uses its own engine to manage data. If you choose File, New and select one of the Project options, you can use the Microsoft Data Engine (MSDE) instead. MSDE is compatible with Microsoft’s enterprise-wide database program, SQL Server.

– Some example of Database engines include

• Xampp

• Wampp

• Lampp

• Mampp

• MSAccess



*A Database Design Checklist


*The biggest single reason a database application fails to materialize into a functional smooth working applications is the lack to planning, pre-development analyze and table layout.

*Before you begin creating database object, think carefully about who will use the database and what kind of reports you will need to produce from the data within it.

*You can use the following checklist to define your design:



*A Database Design Checklist

·Storing data:
 How much data do you plan to enter?

Home much training and expertise will be required of those who are responsible for that data entry?

 Will you need to create systems to ensure accurate and reliable data entry?



*A Database Design Checklist

·Retrieving data:

 What relationships do you need to establish between the different set of data that you produce?

 How can you exploit these relationships to create new combinations of dta from different sources?

 Do you need to subtotal or summarize the data in any way?



*A Database Design Checklist

·Modifying data:

 Who will be responsible for editing data, and what level of understanding will be required of them?

 What safeguards will you need to create to ensure that changes in your database do not result in duplicate records or inconsistent data?

 If several people are using the database, how do you prevent unauthorized changes to data, while still allowing users to retrieve the information they need?



*Database Objects/ Elements

*The basic building blocks of a database are objects.

*Although database supports many types of object, the most common by fare are tables, queries, forms, and reports.

*A database can contain any number of objects. The database wind, which is visible by default when you open a new database, let you create and edit objects contained in the current database.

*Use the database window to see a list of all database objects, arranged by type

* Database Objects/ Elements

*Database objects:

– Provide the interface you use to view, enter, and extract information from a database.

– The most common database objects are

• tables,

• forms,

• queries, and

• reports.



*Tables

*A table is the basic unit for storing a collection of data in a database.

*A table’s definition consists of a list of fields, each of which stores a discrete piece of information for a single record.



– For example, an Employees table might contain the fields EmployeeID, LastName, FirstName, Position, DateHired, and HourlyRate.



*Because each record consists of one complete set of fields, a single record in the Employees table contain all available fields for a single employee.

*Queries

*Queries enable you to extract a subset of data from a single table, from a group of related tables, or from other queries, using criteria you define.



* By saving a query as a database object, you can run the query at any time, using the current contents of the database.



*When you display a query in Datasheet view, it looks exactly like a table; the crucial difference is that each row of the query’s result set can consist of fields drawn from several tables.



* A query can also contain calculated fields, which display results based on the contents of other fields.



*CAUTION

*Forms

*Database forms enable user to enter, view, and edit information, generally one record at a time.



* Yu can design forms that closely resemble pages forms such as invoices and time sheets, or you can create forms that are organized for data entry, complete with data-validation rules.


* A form window can also include a subform that displays information from a related table.

– For example, a form that shows a single record from the Departments table might include a subform that displays all the employees who work in a give department, allowing you to edit information about those employees.


*Reports

*Reports enable you to present data from one or more tables or queries in a readable style and a professional format, generally for printed output.

*A report might include detailed list of specific data, with each row consisting of a single record, or it might provide a statistical summary of a large quantity of information.

*A report design can include grouping and sorting options;


– for example, you might create a weekly sales summary that runs a query, groups the query result set by salesperson, and displays details of each sale in a list beneath each name

How to work with advanced word: Notes lesson 1- 4



ADVANCED WORD


LESSON 1


WORKING WITH TABLES.
How to create a table


Click on table menu.


Select insert then Table.


Specify number of rows & columns.


Click OK.

How to Add a Row/Column


Position a cursor where you want to add a row/column.


Click on Table Menu, Select insert then row above/below

HOW TO MERGE CELLS

Highlight the row.


Click on table menu.


Select merge cells.






HOW TO SPLIT CELLS


Highlight the row(s)


Click on table menu.


Select split cells.


Specify number of columns and number of rows.

DELETING COLUMNS/ROWS


Highlight the Row or Column.


Click on table menu.


Select delete the Column or Row.






SPLITING A TABLE


Position the cursor where you want to divide the table.


Click on table menu.


Select split table.


PLACING BORDERS AROUND THE TABLE


Highlight/select your table.


Click on format menu.


Select borders & shading.


Select border tab.


Then select settings e.g. box, all, custom etc.


Select border styles, color, click Ok.



SHADING YOUR TABLE


Highlight the table.


Click on table menu/click on format menu.


Select borders and shading.


Select shading tab.


Under Fill select the color.


Under pattern select the style.


Click Ok.

TABLE AUTO FORMAT


Highlight the table.


Click on table menu.

Select table auto format.

Under category select all table style.

Select style, under table style.

Click Apply.



SORTING DATA:


Highlight the data (Names)


Click on Table menu


Select sort


Under sort by select the column name


Select: Ascending or Descending


Click Ok.


PERFORMING MATHS IN TABLES


Put the cursor where you want to put the Total, Average, Maximum/Minimum number.


Click on Table Menu.


Select Formula.


Select the appropriate formula e.g.


=Sum (left)


=Sum (above)


=Average (left) etc.



Inserting a worksheet file (excel file) in the Microsoft Word document


Position the cursor where you want to insert your sheet.


Select on Insert Menu.


Select File.


Under file of type


Select All files.


Select Excel file e.g. students’ results


Click Insert


Under open document in workbook:


Select the entire workbook or just single sheet.


Click Ok

LINKING FILES:


Open a blank document (Word document).


Click on insert menu.


Select Hyperlink.


Type the link word e.g. open excel file, this is typed on the *Text to display tab.


Specify the location of the file which you want to create a link for,


Select the file.


Click Ok (*If you are using Office 2000 click Ok again).


Save the link e.g. “My Word link”.


To open a link file, click on the link (* if you are using Office XP press (Ctrl + Click).


LESSON 2:


INSERTING GRAPHIC E.G. CLIP ART.

How to insert clip art


Open the document, which will contain the picture.


Click on insert menu.


Select picture, then Clip Art.


Under search for: Type the category e.g. Animal.


Click on search (if using office XP) or Press


Enter (if using Office 2000).


Right click on picture, select insert, then close Clip Art window.






Setting Clip Art as your background:


Make sure that the picture toolbar is displayed.


Select the picture (select washout/water maker from color/image control).


Click on the text wrapping.


Select Behind text.


* If the text is behind the picture, Right click the picture and select Order then select send behind text



ADDING AUTOSHAPES:


Click on insert menu.


Select picture.


Select auto shapes.


Select e.g. Basic shapes from Auto shapes toolbar.


Select the shape e.g. Rectangle and drag it over the area where you want to put your object.


If you want to apply color


Right click the object.


Select format auto shape.


Select color and lines tab.


Under Fill select the color you want.


Click Ok.


Inserting Graphic Files/e.g. scanned picture


Click on insert menu.


Select picture.


Select from file.


Specify the location e.g. from drive C.


Select the file (picture name).


Click insert.


Working with drawing toolbar:


To access the drawing toolbar (displaying drawing toolbar).


Click on view menu.


Select toolbars.


Put a tick on Drawing.






HOW TO GROUP OBJECTS (in case you want to copy them)


Select the objects one after another (select the first object) then press shift while selecting the rest).


Click on drawing from the drawing toolbar.


Select group.


TO UNGROUP OBJECTS.


Click on Draw from the drawing toolbar.


Select ungroup.


ADDING WORD ART


Click on insert menu.


Select picture.


Select Word Art.


Select the style.


Type the text e.g. ORIGINAL DOCUMENT OR UCC ARUSHA BRANCH.


Click Ok.

WATERMARKS (these are the words behind the text)


Click on view menu.


Select Header & Footer.


Click Insert Menu.


Select Picture.


Select Word Art.


Select Style.


Click Ok.


Type the text e.g. SAMPLE.


Click Ok.


Click on text wrapping symbol from Word Art Toolbar.


Re-size your text.


Select behind text.


Close Header & Footer Toolbar.




Removing water Marker


- Click on View menu


- Select header and footer


- Select the text to be removed


- Press delete key


- Click on save button to save changes


APPLYING WATER MARKER (When you are using office XP)


Click on Format Menu.


Select Background.


Select Printed Water marker.


Click Ok.


Point on * Text Water mark


*Under text, type e.g. SAMPLE


- Select size and Color.


- Click Apply then Ok



LESSON 3:

MAIL MERGE:


Mail Merge is a feature used to print a number of copies of letters or any other document which have more or less the same contents but differ in few details (may be names & addresses are different in each mail. In mail (MAIL MERGE) there is only one document having the text which is the same for every copy, it is called “MAIN DOCUMENT”. The information that differs from one copy to another is called “DATA SOURCE” (ADDRESSES). The main document & data source are prepared separately and then at the end they are merged (combined) into a single file with several copies.



MAIL MERGING: (When using office 2000)


Type a letter and save it.


Open the letter (in case it is not open).


Click on Tools Menu.


Select Mail Merge.


Under Main Document:


Click on Create.


Select form letters.


Click on Active window.

From main “Data Source”


Click on Get data


Click on Create Data Source.


Remove unwanted fields.


Click Ok.


Save your data sources.


Click on Edit data source.


Type Addresses, click on Add new after each address, when you are through click Ok.


Put the cursor where you want to put the addresses


Click on insert merge fields from mail merge toolbar.


Select all fields starting with e.g. Title, First name etc.


Click on ABC symbols in order to view records


Then click on Merge to new document symbol from the mail merge toolbar.


Save your document.


MAIL MERGE


(When using Office XP)


- Open the document (e.g. letters to be given to different people)


- Click on Tools Menu


- Select Letters and mailing


- Click on Mail Merge Wizard


- Select Letters


- Click Next: starting document


- Select Use the current document


- Click on Next: Select recipients


- Select *Type a new list


- Click on Create


- Click on Customize


- Delete unwanted field Name


- Click OK


- Type address and click on New Entry to type the next address


- When you are through, Click Close


- Save your addresses (data sources)


- Click on Select all


- Click OK


- Click on Insert Merge fields symbol from the Mail Merge Toolbar


- Select Database fields


- Select all the fields you want e.g. Title, First Name, Surname etc.


- Click Insert


- Close


- Put the cursor where you want to put your addresses


- Click on merge to New document from Mail merge Toolbar


- Under merge records, Select All


- Click Ok


- Save your document



Footnotes and Endnotes


You can include a footnote within a document to help explain comment or provide a reference for any text within a file. Typically footnotes are used to reference the source of your information, Ms Word allows you to include both footnotes and endnotes within the same document. Footnotes appears at the bottom of the page they are referring, while endnotes are displayed at the end of the document or section


Adding footnotes/endnotes


- Place the cursor where you want your footnotes to appear e.g. after the word UCC


- Click on Insert menu


- Select Reference (When using Office XP)


- Select footnotes


- Select footnotes or endnotes


- Click OK


- Type the meaning i.e. University Computing Centre


Page Break


- Position the cursor where you want to apply page break


- Click on Insert Menu


- Select Break


- Select page break


- Click OK


Inserting Page Numbers:


- Click on Insert Menu


- Select Page Numbers


- Click Format


- Select e.g. 1, 2, 3 OR -1-, -2-, -3- etc.


- Select Continue to from previous section


- Click OK


- Click OK again



Section Break (This is done if you want to use different numbers formats within one document e.g. 1, 2, 3 etc. and i, ii, iii, etc.)


* Having inserted page numbers;


- Put the cursor on the word of the last page of the section which you want to apply different number format e.g. i, ii, iii etc.


- Click on Insert Menu


- Select Break


- Under Section break types, Select Next Page


- Click OK


- Press Delete (to delete empty page)


- Click Insert menu


- Select Page Numbers


- Click on format


- Select 1, 2, 3


- Select Start at: 1


- Click OK then OK.


- Put the cursor on the first page (the area to apply roman numbers i.e. i, ii, iii etc.


- Click on Insert menu


- Select page numbers


- Click on format


- Select i, ii, iii etc.


- Select start at i.


- Click OK, then OK



LESSON 4:

ADDING TABLE OF CONTENTS


STEPS:

- Select all the headings to be put in the table of contents; start with the First heading e.g. Working with tables


- Click on heading styles i.e. heading selection box (under normal box) on the formatting tool bar.


- Select heading 1.


- After selecting heading 1; do the following:


- Place the cursor where you want to put the table of contents.


- Click on Insert Menu.


- Select references or index and tables.


- Select table of contents tab.


*Under show levels; select 1.


- Click ok.


Adding levels 2, 3 etc. (Sub-headings)


- Highlight the word to be put in the table of contents as a sub heading e.g. re-sizing the table


- Click on the heading selection box (under normal box) on the formatting tool bar.


- Select heading 2


- Click on Insert Menu.


- Select reference or index and tables.


*Under show levels; select 2.


- Click Ok.


*In case the document has moved down to a different page from the one indicated on the table of contents; updated the table of contents by doing the following:-


- Put the cursor in the table of contents.


- Right click.


- Select updated Field.


- Then updated the entire table.

*In case you want to remove some headings from the table of content; do the following:-


- Highlight the text e.g. re-sizing tables from the document (in the document area and not in the table of contents).


- Click on the heading selection box (under normal box).


- Select normal.


- Put the cursor in the table of contents area.


- Right click.


- Select update field.


- Select entire table.


- Click ok.


MASTER DOCUMENT .


A master document can be used to store a set of `sub documents’ that are saved


as separate files. (Microsoft word files only.)

Creating a Master Document.

- Open a blank document.


- Click on view menu.


- Select outline.


- Type the text e.g. open student file.


- Click on insert sub document symbol from the toolbar.


- Specify file location (the place where the file is located).


- Select the file.


- Click open.


- Save your master document.


- Close master file


- Open the file (Master file), a link will be displayed, click on that link.


*If you want to create several links in the master document do the following:


- While you are on the master document; type another text below the first link e.g. Open tutors file.


- Click on Expand sub document symbol on the toolbar.


- Then click on insert sub document symbol on the toolbar.


- Specify the file location.


- Select the file.


- Click open.


- Save the changes (i.e. click on `save’ not `save as’)


- Close the master document.


- Open it, click on the link in order to open the file.



CREATING AN INDEX.

You may want to create an index for a document. An index may include both headings and sub headings and you can choose how the page numbers are to be displayed and printed.


Creating an index in ms word is a two step process. You must first mark the entries to be included within the index and then actually insert the index into your documents.


MARKING INDEX ENTRIES.

- Select the first word (entry) to be included in the index.


- Press alt + shift + * (or click on insert menu, select reference, index and table,


- Click on mark entry.


- Highlight the word (entry) inside the main entry.


- Click on mark (or mark all if the word appears in different pages)


- Select the next entry (word) to be put in index, click inside the main entry box, and highlight the word (entry).


- Click on mark or mark all.


- Continue until all entries are done.


- Click close when finished.

To insert the index.


- Place the cursor where you want to insert the index.


- Click on insert menu.


- Select reference, then index and tables.


- Click on Right align page numbers.


- Select e.g. 1 column.


- Click ok.




Evolution and History of Programming Languages Software/Hardware/System

Evolution and History of Programming Languages


EVOLUTION

To write a program for a computer, we must use a computer language. A computer language is a set of predefined words that are combined into a program according to predefined rules (syntax). Over the years, computer languages have evolved from machine language to high-level languages.

Machine languages

In the earliest days of computers, the only programming languages available were machine languages. Each computer had its own machine language, which was made of streams of 0s and 1s. In Chapter 5 we showed that in a primitive hypothetical computer, we need to use eleven lines of code to read two integers, add them and print the result. These lines of code, when written in machine language, make eleven lines of binary code, each of 16 bits, as shown in Table 9.1.



Machine languages (first-generation languages) are the most basic type of computer languages, consisting of strings of numbers the computer's hardware can use.

Different types of hardware use different machine code. For example, IBM computers use different machine language than Apple computers

Assembly languages

The next evolution in programming came with the idea of replacing binary code for instruction and addresses with symbols or mnemonics. Because they used symbols, these languages were first known as symbolic languages. The set of these mnemonic languages were later referred to as assembly languages. The assembly language for our hypothetical computer to replace the machine language in Table 9.2 is shown in Program 9.1.

Assembly languages (second-generation languages) are only somewhat easier to work with than machine languages.To create programs in assembly language, developers use cryptic English-like phrases to represent strings of numbers.The code is then translated into object code, using a translator called an assembler.


Software Development Life Cycle Models



Software Development Life Cycle Models

The General Model

Software life cycle models describe phases of the software cycle and the order in which those phases are executed. There are tons of models, and many companies adopt their own, but all have very similar patterns. The general, basic model is shown below:



General Life Cycle Model

Each phase produces deliverables required by the next phase in the life cycle. Requirements are translated into design. Code is produced during implementation that is driven by the design. Testing verifies the deliverable of the implementation phase against requirements.

Requirements

Business requirements are gathered in this phase. This phase is the main focus of the project managers and stake holders. Meetings with managers, stake holders and users are held in order to determine the requirements. Who is going to use the system? How will they use the system? What data should be input into the system? What data should be output by the system? These are general questions that get answered during a requirements gathering phase. This produces a nice big list of functionality that the system should provide, which describes functions the system should perform, business logic that processes data, what data is stored and used by the system, andhow the user interface should work. The overall result is the system as a whole and how it performs, not how it is actually going to do it.

Design

The software system design is produced from the results of the requirements phase. Architects have the ball in their court during this phase and this is the phase in which their focus lies. This is where the details on how the system will work is produced. Architecture, including hardware and software, communication, software design (UML is produced here) are all part of the deliverables of a design phase.

Implementation

Code is produced from the deliverables of the design phase during implementation, and this is the longest phase of the software development life cycle. For a developer, this is the main focus of the life cycle because this is where the code is produced. Implementation my overlap with both the design and testing phases. Many tools exists (CASE tools) to actually automate the production of code using information gathered and produced during the design phase.

Testing

During testing, the implementation is tested against the requirements to make sure that the product is actually solving the needs addressed and gathered during the requirements phase. Unit tests and system/acceptance tests are done during this phase. Unit tests act on a specific component of the system, while system tests act on the system as a whole.

So in a nutshell, that is a very basic overview of the general software development life cycle model. Now lets delve into some of the traditional and widely used variations.


Waterfall Model

This is the most common and classic of life cycle models, also referred to as a linear-sequential life cycle model. Itis very simple to understand and use. In a waterfall model, each phase must be completed in its entirety before the next phase can begin. At the end of each phase, a review takes place to determine if the project is on the right path and whether or not to continue or discard the project. Unlike what I mentioned in the general model, phases do not overlap in a waterfall model.

Waterfall Life Cycle Model

Advantages
Simple and easy to use.
Easy to manage due to the rigidity of the model – each phase has specific deliverables and a review process.
Phases are processed and completed one at a time.
Works well for smaller projects where requirements are very well understood.

Disadvantages
Adjusting scope during the life cycle can kill a project
No working software is produced until late during the life cycle.
High amounts of risk and uncertainty.
Poor model for complex and object-oriented projects.
Poor model for long and ongoing projects.
Poor model where requirements are at a moderate to high risk of changing.

V-Shaped Model

Just like the waterfall model, the V-Shaped life cycle is a sequential path of execution of processes. Each phase must be completed before the next phase begins. Testing is emphasized in this model more so than the waterfall model though. The testing procedures are developed early in the life cycle before any coding is done, during each of the phases preceding implementation.

Requirements begin the life cycle model just like the waterfall model. Before development is started, a system test plan is created. The test plan focuses on meeting the functionality specified in the requirements gathering.

The high-level design phase focuses on system architecture and design. An integration test plan is created in this phase as well in order to test the pieces of the software systems ability to work together.

The low-level design phase is where the actual software components are designed, and unit tests are created in this phase as well.

The implementation phase is, again, where all coding takes place. Once coding is complete, the path of execution continues up the right side of the V where the test plans developed earlier are now put to use.


V-Shaped Life Cycle Model



Advantages
Simple and easy to use.
Each phase has specific deliverables.
Higher chance of success over the waterfall model due to the development of test plans early on during the life cycle.
Works well for small projects where requirements are easily understood.

Disadvantages
Very rigid, like the waterfall model.
Little flexibility and adjusting scope is difficult and expensive.
Software is developed during the implementation phase, so no early prototypes of the software are produced.
Model doesn’t provide a clear path for problems found during testing phases.

Incremental Model

The incremental model is an intuitive approach to the waterfall model. Multiple development cycles take place here, making the life cycle a “multi-waterfall” cycle. Cycles are divided up into smaller, more easily managed iterations. Each iteration passes through the requirements, design, implementation and testing phases.

A working version of software is produced during the first iteration, so you have working software early on during the software life cycle. Subsequent iterations build on the initial software produced during the first iteration.

Incremental Life Cycle Model



Advantages
Generates working software quickly and early during the software life cycle.
More flexible – less costly to change scope and requirements.
Easier to test and debug during a smaller iteration.
Easier to manage risk because risky pieces are identified and handled during its iteration.
Each iteration is an easily managed milestone.

Disadvantages
Each phase of an iteration is rigid and do not overlap each other.
Problems may arise pertaining to system architecture because not all requirements are gathered up front for the entire software life cycle.

















The Six Steps in the Program Development Life Cycle (PDLC)



The Six Steps in the Program Development Life Cycle (PDLC)

The process of developing a software, according to thedesired needs of a user, by following a basic set of interrelated procedures is known as ProgramDevelopment Life Cycle.PDLC includes various set of procedures and activitiesthat are isolated and sequenced for learning purposesbut in real life they overlap and are highly interrelated.

Tasks of Program Development

The basic set of procedures that are followed by variousorganisations in their program development methods are as follows:

Step 1 - analyze problem

Step 2- design / define the programs

Step 3 - code programs

Step 4 - test programs

Step 5 - formalize solution

Step 6 - maintain programs


Step 1, analyze/ Define the problem

Analyze problem, consists of reviewing program specifications; meeting with the analyst and users; and identifying program componentsAnalysis Phase.

In the analysis phase the requirements gathered in the requirements phase, are used to create report definitions and layouts, screen definitions and layouts, data element definitions, workflow diagrams, and security matrices. This phase culminates in the creation of a “logical” model of the application.

Step 2, design programs

Design programs, involves grouping activities into modules, devising solution algorithms, and testing the algorithms.

In the design phase the logical model developed in the analysis phase, is used to develop a “physical” model of the application. The physical model contains business object logic, database schemas identifying relationships, web object design and layout, report calculations and processing, and the security object definition.

Step 3, code programs.

Code programs, entails translating the solution algorithm into a programming language and entering program code into the computer

In the coding/development phase the individual objects or components of the application are coded from the physical model. Once the system objects have been developed, they are gathered and connected together (integrated) to create a working application. The integrated application is placed on a staging server for testing.

Step 4, test programs.

Test programs, consists of correcting syntax errors and logic errors. The testing phase encompasses three testing stages; component testing, requirements testing, and acceptance testing. During component testing, all objects are tested to ensure they work together as specified by the physical design. Once the components are tested and the system operates as designed, the application is tested against the requirements gathered in the requirements phase of development. Once the requirements testing stage is completed, the system is presented to the business function for acceptance testing. In all testing stages, defects are identified and returned to the development/coding phase for correction.

Step 5, formalize solution.

Formalize solution, includes reviewing program code and documentation. The deployment phase contains two stages, a three- to six-month pilot followed by a national deployment. At the conclusion of the pilot, the finished application is placed on a production server. Users are trained, user guides are delivered, and the system is distributed nationally. The application is then maintained by the TIGTA’s Central Support Facility (TCSF).


Step 6, maintain programs /Maintenance Phase.

Maintain programs, involves correcting errors and adding enhancements.In the maintenance phase the deployed application is maintained through scheduled backups. Any changes to the application are presented to the Change Control Board for approval. If a change or enhancement has been approved by the CCB, it is presented to the Requirements Team and the software development life cycle begins again.



Programing languages lesson 1



COMPUTER PROGRAMMING LANGUAGES

Introduction

By the end of this Topic, you should …

• Explain the concept of programming

• Understand the different types of programming languages.

• Describe the programming life cycle.

• Select appropriate programming Language

• Understand the concept of algorithms

• Use pseudo-code and flow-charts to solve problems

• Identify data structure

• Design a program

• Apply Control structure in program design.

• Develop functions.

• Develop array and string.


Concept of Programming

l Program – a very specific set of instructions (or command lines) that making a computer do what you want it to do


l Programming – the process of creating a program the development of a solution to an identified program, and setting up of a related series of instructions which, when directed through computer hardware, will produce the desired results


l A programming language is an artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine, to express algorithms precisely, or as a mode of human communication


For example:-

- PASCAL, C, JAVA, C++, VISUAL BASIC, ADA, LISP, FORTRAN, COBOL, PROLOGUE, PYTHON, C# etc

WHY STUDY PROGRAMMING LANGUAGES?

1. To improve your understanding of the language you are using.

- Many languages provide features when used properly are of benefit to the programmer but when used improperly may waste large amounts of computer time or lead the programmer into time-consuming logical errors.

Eg. Use of array and single variable data storage



2. To increase your vocabulary of useful programming constructs.

- Language or the syntaxes/commands aid the programmer to implement the logic of the program

- In searching for the data and program structures suitable to the solution of a problem, one tends to think only of structures that are immediately expressible in the languages with which one is familiar.

- By studying the constructs provided by the wide range of languages and the manner in which these constructs are implemented, the programmer increases his programming “vocabulary”.


3. To allow better choice of programming language

- Ex. C and Java


4. To make it easier to learn a new language

- A thorough knowledge of a variety of programming language constructs and implementation techniques allows the programmer to learn constructs and implementation techniques allows the programmer to learn a new language more easily when the need arises


5. To make it easier to design a new language

- The user interface can be designed by a programmer if he has a thorough knowledge of the p.l.

- The user interface consists of the commands and data formats that are provided for the user to communicate with the program

- The aspect of program design is often simplified if the programmer is familiar with a variety of constructs and implementation methods from ordinary programming languages.





Types of Programming Ltanguages

l Three types of programming languages

– Machine languages

l Strings of numbers giving machine specific instructions

l Example:

+1300042774 (these would really be in binary)

+1400593419

+1200274027

MACHINE LANGUAGES

v Comprised of 1s and 0s

v The “native” language of a computer

v Difficult to program – one misplaced 1 or 0 will cause the program to fail.

Example of code;
1110100010101 111010101110
10111010110100 10100011110111

– Assembly languages

l English-like abbreviations representing elementary computer operations (translated via assemblers)

l Example:

LOAD BASEPAY

ADD OVERPAY

STORE GROSSPAY

ASSEMBLY LANGUAGES

v Assembly languages are a step towards easier programming.

v Assembly languages are comprised of a set of elemental commands which are tied to a specific processor.

v Assembly language code needs to be translated to machine language before the computer processes it.

Example:
ADD 1001010, 1011010

NB: Assembler:- A program for converting instructions written in low-level symbolic code into

machine code.

- A computer program which translates from assembly language to an object file or machine language format

- An assembler is a type of computer program that interprets software programs written in assembly language into machine language, code and instructions that can be executed by a computer.


– High-level languages

l Instructions closer to everyday English

– English is a natural language. Although high level programming languages are closer to natural languages, it is difficult to get too close due to the ambiguities in natural languages (a statement in English can mean different things to different people – obviously that is unacceptable for computer programming).

– Use mathematical notations (translated via compilers)

Example:

grossPay = basePay + overTimePay

– Interpreter – Executes high level language programs without compilation.

HIGH-LEVEL LANGUAGES

v High-level languages represent a giant leap towards easier programming.

v The syntax of HL languages is similar to English.

v Historically, we divide HL languages into two groups:

– Procedural languages

– Object-Oriented languages (OOP)

A compiler:-

- Is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor.The file that is created contains what are called the source statements.

- Is a program that translates a source program written in some high-level programming language (such as Java) into machine code for some computer architecture (such as the Intel Pentium architecture). The generated machine code can be later executed many times against different data each time.

An interpreter:–

- Is a program that reads an executable source program written in a high-level programming language as well as data for this program, and it runsthe program against the data to produce some results.

- One example is the Unix shell interpreter, which runs operating system commands interactively

- Note that both interpreters and compilers (like any other program) are written in some high-level programming language (which may be different from the language they accept) and they are translated into machine code. For example, a Java interpreter can be completely written in Pascal, or even Java. The interpreter source program is machine independent since it does not generate machine code. (Note the difference between generate and translated into machine code.) An interpreter is generally slower than a compiler because it processes and interprets each statement in a program as many times as the number of the evaluations of the statement.

Compilers and interpreters are not the only examples of translators. Here are few more:
Source Language
Translator
Target Language
LaTeX
Text Formater
PostScript
SQL
database query optimizer
Query Evaluation Plan
Java
javac compiler
Java byte code
Java
cross-compiler
C++ code
English text
Natural Language Understanding
semantics (meaning)
Regular Expressions
JLex scanner generator
a scanner in Java
BNF of a language
CUP parser generator
a parser in Java


NB:-Some programs are translated using an interpreter. Such programs are translated line-by-line instead of all at once (like compiled programs). Interpreted programs generally translate quicker than compiled programs, but have a slower execution speed.
Procedural Languages
v  Early high-level languages are typically called procedural languages.
v  Procedural languages are characterized by sequential sets of linear commands. The focus of such languages is on structure.
v  Examples include C, COBOL, Fortran, LISP, Perl, HTML, VBScript

Object-Oriented Languages
v  Most object-oriented languages are high-level languages.
v  The focus of OOP languages is not on structure, but on modeling data.
v  Programmers code using “blueprints” of data models called classes.
v  Examples of OOP languages include C++, Visual Basic.NET and Java.