1. Trang chủ
  2. » Công Nghệ Thông Tin

programming language fortran

31 177 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 31
Dung lượng 275 KB

Nội dung

Programming language Portran • Programming skills are not essential, but they are useful for: – Special data processing; – Customisation Computers • The processor (or CPU) can be thought of as the ‘heart’ of the computer as it controls the flow of information around the system. • The processor requires instructions telling it what to do. These are provided by the operating system (OS). • All instructions to the processor are in machine code. [...]... execution by a Java Virtual Machine (JVM) for a particular platform Programming Paradigms • There are two main programming paradigms • Older languages (e.g Fortran, Basic, Cobol, Pascal, C) use a procedural (or imperative) paradigm • Newer languages (Visual Basic, C++, Delphi, Java and C#) are more likely to be object orientated Procedural Languages • In the early days programs were usually run as batch... Development Environment (IDE) • The newer languages tended to GUI orientated, but not all object orientated languages are ‘visual’ Web Scripting Languages • The explosion of the Internet and more especially the World Wide Web in the 1990s created a demand for new technologies • All web pages are written in HTML (hypertext markup language) • This is not really a language at all, just a ste of tags that... they are no longer strictly sequential • Each element in a GUI can be treated as a discrete object, so object orientated languages tended to come to the fore, although the procedural languages still have their supporters Object Orientated Languages(2) • The new object orientated languages provide windows, button, menus etc as pre-written objects, making it simple to build a graphical user interface... a ste of tags that can be used to control the display of fonts • Early web pages were static, so new scripting languages (e.g JavaScript, VBScript, tcl, and PHP) emerged to provide dynamic content • Mostly interpreted, either client-side or server side Programming Structures • Procedural programming is essentially sequential • Branches enable the program to go in different directions in different... punched cards, line printers) • In the 1970s keyboards and text monitors allowed programs to be more interactive, but this did not really affect the way in which the languages operated (i.e, they were still basically sequential) Object Orientated Languages(1) • The availability of graphics monitors and mice in the 1980s facilitated the introduction of WIMP technology (windows, icons, menus and pointers)... TOTAL + D(I); NEXT • The ethos of procedural programming is encapsulated by a flow diagram Procedures • In many situations you might find yourself doing the same type of operation several times within a single program, or you may find yourself doing the same operation in different programs • Rather than write new code each time it is required, procedural languages allow you to write it as a procedure,... Example FUNCTION MEAN (ARRAY, N) DIMENSION MEAN(N) SUM=0.0 DO 10 I=1,N 10 SUM=SUM+ARRAY(I) MEAN=SUM / N RETURN END … DIMENSION A(3), B(5) MEANA = MEAN(A, 3) MEANB = MEAN(B, 5) Modularity • In some languages the procedure may directly operate on the variables in the main program • However, greater flexibility is provided using arguments and parameters • Arguments are the actual values passed by the... procedure • Procedures can be stored in libraries, and linked in as required • Procedures also provide a useful means of clarifying the logic in a program, even if only called once Object Orientated Programming • A class is the name given to a collection of objects – it can also be thought of as a template • An object has: – A set of characteristics (attributes or properties) – A set of things it... Creating an object (class instance): $myObject = new myClass; PHP Examples(2) • Setting the property of an object: $myObject->myValue = “Data Value”; • Calling a method: $myObject->myMethod(); • N.B Most languages use dots rather than -> Inheritance • You can create lots of objects from a single class – e.g specific students from student class • You can also modify a class to create a new class (inheritance)... class from the students class • Different classes can have different methods defined for the same instruction (polymorphism) • The object orientated equivalent of a flow diagram is a Unified Modelling Language (UML) diagram This shows the relationship between objects Inheritance Aggregation Association Instantiation Holiday Overdraft Components Components • The Object Orientated approach is replicated . platform. Programming Paradigms • There are two main programming paradigms. • Older languages (e.g. Fortran, Basic, Cobol, Pascal, C) use a procedural (or imperative) paradigm. • Newer languages. Assembley Language: LDA NUM1 CLC ADC NUM2 STA SUML LDA #0 STA SUMH ADC SUMH STA SUMH In a high level language like Fortran this would be: SUM = NUM1 + NUM2 Translation • Irrespective of the language. Level Languages • Some high level languages are lower level than others • C is a ‘lower’ level high level language – i.e. it gives more control and also runs faster than other high level languages,

Ngày đăng: 24/10/2014, 21:28