34

Software Development

  • Upload
    ita

  • View
    25

  • Download
    1

Embed Size (px)

DESCRIPTION

Software Development. Languages and Environments. Computer Languages. Just as there are many human languages, there are many computer programming languages that can be used to develop software. - PowerPoint PPT Presentation

Citation preview

Page 1: Software Development
Page 2: Software Development

Just as there are many human languages, there are many computer programming languages that can be used to develop software.

Some are named after people, such Ada and Pascal. Some are abbreviations, such as PL/1 and Prolog.

Prolog is good for developing programs in artificial intelligence. COBOL is for developing commercial data processing programs.

Page 3: Software Development

The are two different kinds of programming languages;

› Low Level Languages› High Level Languages

Page 4: Software Development

Processors only understand binary.

Instructions and commands made in binary digital form is known as machine codes.

Here are a few machine codes for a 6502 processor:

10101001 00000001 10000101 01110000 10100101 01110000

I’m sure you’ll agree that they are not very easy to understand.

Machine codes are an example of low level languages,

Page 5: Software Development

They do not need to be translated into binary

Page 6: Software Development

machine codes for different processors are different

they are very hard for humans to understand and use

they take up a lot of space to write down

it is difficult to spot errors in the codes (debug).

Page 7: Software Development

To get round these difficulties, computer scientists invented high level languages.

› Prolog› Java

Page 8: Software Development

High level languages (HLL) are similar to human languages.

Instead of using binary codes, they use ‘normal’ words.

› For example, the computer language JAVA uses words like;

PRINT IF THEN,

That means that high level languages are easier to understand than machine code, and are more ‘readable’, meaning, it is easier to spot and correct errors.

Page 9: Software Development

High level languages are easier to understand than machine codes and are more readable.

It is easier to find mistakes using HLLs

Page 10: Software Development

HLLs must be translated into machine code so that the processor can understand the instructions› This can slow down the running of the

program› This can use more hardware resources to

store the program; i.e. we now have to store the HLL program, the translator and the machine code

Page 11: Software Development

1. Which type of language (high or low level) is easier to understand?

2. Which type would be easier to correct if it had a mistake in it?

3. Name two high level languages.4. Explain the difference between high

and low level languages.5. List two advantages of high level

languages.

Page 12: Software Development

Processors don’t understand high level languages at all! To get round this problem, translator programs have been developed to translate programs written in high level languages into machine code.

Page 13: Software Development

There are two main types of translator program;

›Interpreters›Compilers

Although both of these utilities do the same task (convert HLL to machine code) they both work differently)

Page 14: Software Development

The interpreter translates high level language program code as it is being written.

If takes each line of high level language code and translates it into machine code and passes it to the processor to carry out that instruction.

It works its way through the high level language program one line at a time.

This process of translation must take place every time the program is run.

Page 15: Software Development

Errors are highlighted as soon as the line is written showing exactly where the error is.

Page 16: Software Development

Interpreted programs are slow to run. The interpreter runs every time the

program is run. This is a waste of time and resources.

Page 17: Software Development

The compiler takes your HLL program and translates the whole program into machine code at the same time.

Any errors are reported in a batch once all the lines of code have been translated

The machine code version of the program is saved.

The program is then run from the saved machine code, with the result that the program only has to be translated once.

Page 18: Software Development

Running the machine code version of the code is very fast.

Running the machine code version of the code does not waste computer resources.

Page 19: Software Development

Harder to find and edit mistakes when given in a batch

Running a compiler is time consuming

Page 20: Software Development

The compiler translates the whole program at the same time at the end and saves it as object code.

The interpreter translates the program one line at a time as the code is being written, therefore identifying errors as they are written.

The compiler only need to translate the program once and then it can be run from the saved object code.

The interpreter has to translate the code every time it is run .

Interpreted code takes longer to run than compiled code, because of this repeated translation process.

Page 21: Software Development

1. Name two main types of translator program.

2. Which one translates the whole program into machine code before it is executed?

3. Which one translates a program line by line as it is being written?

4. Why do machine code programs run more quickly on a computer than high level language programs?

Page 22: Software Development

We use text editors at the implementation stage of the Software Development Process.

Text editors are used to enter and edit program code, i.e. We write our code in a text editor and can fix any errors here too.

A text editor is a similar tool to a word processor and shares many of the same features.

The most useful of these is the ability to cut/copy and paste sections of code.› As you will soon realise when you start programs

the same sections of code are reused often and copy and paste saves you from having to retype the entire section.

Page 23: Software Development

A Scripting Language is a special type of High Level Language.

Scripting Languages are embedded within existing application packages, e.g. Microsoft Excel, Microsoft Word.

Using a Scripting Language we can create a macro, which is a way of carrying out multiply tasks with a single key-stroke.

Page 24: Software Development

Choose record macro Carry out the steps you want to record Press stop recording Assign to a keystroke

Page 25: Software Development

Set up a small spreadsheet as below and save it as course.xlsSave a second copy of the same spreadsheet as course_copy.xls.

Page 26: Software Development

From the Tools menu, select Macro, then Record New Macro.The following dialog box should appear:

Enter the name (tidy_up_SS)

And the shortcut key (Ctrl + Shift + K)

Then OK

Page 27: Software Development

WARNING!!! Follow the se instructions very carefully

–all your actions are being recorded!Select cell A1 (the title of the spreadsheet)Change its font to 18pt BoldSelect A3 to D13 (all the data)Centre it all using the centre button on the

menu barSelect row 3 (the column headings)Make them bold.

Page 28: Software Development

The spreadsheet should now look like this:

Click on Stop Recording

Save the improved spreadsheet as course2.xls

Page 29: Software Development

All the series of actions that you applied to course.xls to turn it into course2.xls have been recorded and stored as a macro.

To see the macro you have created:› go to the Tools menu› select Macro› select Macros

Page 30: Software Development

A dialog box like this should appear, with your named macro listed under the name you gave it.

Click on Edit

Page 31: Software Development

Another window will open, which displays the code of the macro you have recorded.

The macro is actually coded in a scripting language called Visual BASIC for Applications or VBA for short.

Page 32: Software Development

Keep course2.xls open Open course_copy.xls Hold down Ctrl + Shift + K

The file course_copy.xls should be automatically formatted by the macro to be the same as course.xls

If the user has several similar unformatted spreadsheets and wanted them all formatted in this way, he could save a great deal of time by using a macro.

Page 33: Software Development

A macro is a time-saving program written in a scripting language which can be activated by a series of key strokes for repeat use.

A macro cannot exist alone – it only works with an application program (in this case Excel).

Page 34: Software Development

Examples of when you would use a macro› If you wanted to repeatedly search and sort a

database using the same conditions it would be easier and quicker to use a macro

› If you wanted to repeatedly do a mail merge again it would be easier to use a macro

› If you wanted to change all of the headings in this presentation to Comic Sans you could use a macro instead of having to manually change each page.