22
PROGRAMMING 3 RD GRADING PERIOD – LESSON 2

Programming lesson1

Embed Size (px)

Citation preview

Page 1: Programming lesson1

PROGRAMMING3RD GRADING PERIOD – LESSON 2

Page 2: Programming lesson1

What is Programming?

Programming is a creative process done by programmers to instruct a computer on how to do a task.

Programming is instructing a computer to do something for you with the help of a programming language.

Page 3: Programming lesson1

What is a Program? In computing, a program is a specific set of ordered

operations for a computer to perform. In the modern computer that John von Neumann outlined in 1945, the program contains a one-at-a-time sequence of instructions that the computer follows. Typically, the program is put into a storage area accessible to the computer. The computer gets one instruction and performs it and then gets the next instruction.

Page 4: Programming lesson1

What is a Programmer?

A programmer is a person who prepares instructions for computers.

Page 5: Programming lesson1

A programmer needs to develop a well-defined concept of how to solve a problem. Then this concept must be translated into a computer language. Finally, the program needs to be typed into the computer, tested, and debugged before being placed into service.

Page 6: Programming lesson1

What is a Programming Language?

Programming Language is a language used to give instructions to computers.

Page 7: Programming lesson1

During the 1960s and 1970s, a huge variety of programming languages were developed, most of which are no longer in wide use. Moreover, a substantial amount of programming is now done with special program development tools (e.g., Visual Basic), or in programming languages that pertain to specific pieces of software (e.g., Maple) rather than by simply writing instructions in a general-purpose language.

Page 8: Programming lesson1

The following is a rough classification of programming languages.1. General-purpose languages for large, complex programs: PL/I, C, C++, Pascal,

Modula-2, Ada, Java, C#.2. General-purpose languages for smaller programs: BASIC, Visual Basic, Pascal,

Python.3. Mathematical calculation, science, and engineering: FORTRAN, APL, Maple, and

the general-purpose languages named above.4. Business data processing: COBOL, RPG. Where microcomputers are involved,

BASIC, C, and languages associated with specific database products are also widely used.

5. Artificial intelligence and programs of extreme logical complexity: Lisp and Prolog.

6. String handling and scripting: SNOBOL, REXX, Awk, Perl, Python, VBSCRIPT, JavaScript.

Page 9: Programming lesson1

Another useful classification is based on the way the program is organized.

1. Sequential languages treat the program as a series of steps, with an occasional GOTO statement as a way of breaking out of the sequence. In this category are FORTRAN, BASIC, and COBOL(though COBOL also allows programs to be written in a style more like a block-structured language).

Page 10: Programming lesson1

2.Block-structured languages encourage structured programming by allowing the programmer to group statements into functional units. This category originated with Algol and now includes Pascal, Modula-2, C, PL/I, and Ada.

Page 11: Programming lesson1

Structured Programming?

Structured programming is a programming technique that emphasizes clear logic, modularity, and avoidance of GO TO statements (which are intrinsically error-prone).

Structured programming is a style of programming designed to make programs more comprehensible and programming errors less frequent.

Page 12: Programming lesson1

3.Object-oriented languages allow the programmer to define new data types and associate procedures with them. Languages of this type include C++, Java, C#, object-oriented extensions of Pascal, and Smalltalk.

Page 13: Programming lesson1

4.Symbolic languages allow the program to examine and modify itself, treating instructions as data. Lisp and Prolog fall into this category.

Page 14: Programming lesson1

Although names of some programming languages are normally written in all capital letters, names of most languages are not, even if they are acronyms. Usage varies from language to language. With some, usage has shifted over the years.

Page 15: Programming lesson1

BASIC?BASIC (Beginner’s All-purpose Symbolic Instruction

Code) a computer language designed by John Kemeny and Thomas Kurtz in 1964 and popularized by Microsoft in the 1970s.

BASIC is good for programming simple calculations quickly, and you do not have to learn much of the language in order to begin using it.

Because no declarations are required, programs can be quite short.

Page 16: Programming lesson1

In the 1970s and 1980s, numerous software vendors, especially Microsoft, added features to BASIC to support STRUCTURED PROGRAMMING and a wide variety of DATASTRUCTURES. Today, BASIC is one of the most complex programming languages in wide use, incorporating features from Pascal, FORTRAN, and C. Line numbers are no longer necessary.

However, BASIC is still easy for beginners to use, and the newest BASIC compilers still accept programs written in Kemeny and Kurtz’s original language.

Page 17: Programming lesson1

BASIC program and its output

10 REM Temperature conversion program20 PRINT ”Temperature in Fahrenheit”;30 INPUT F40 LET C=(F-32)*5/950 PRINT F;” F equals ”;60 PRINT C;” C”70 ENDTemperature in Fahrenheit? 9898 F equals 36.66667 C

Page 18: Programming lesson1

VISUAL BASIC?

One of the first successful interactive development environments for Windows programming, introduced by Microsoft in 1991.

Programmers can lay out the program’s windows graphically and write BASIC code to specify what happens when each button is clicked or other events occur.

Any part of the layout or code can be changed at any time. Unlike in earlier Windows programming environments, the

programmer need not write any general code to initialize windows, handle events, or interact with the operating system.

Page 19: Programming lesson1

The current version is called Visual Basic .NET or VB.NET and uses the .NET Framework for fully object-oriented programming. Similar products for other programming languages include Microsoft’s Visual C++ and Visual C# and Borland’s Delphi and Kylix (for Pascal), JBuilder (for Java), and C++ Builder.

Page 20: Programming lesson1
Page 21: Programming lesson1

.NET Framework? An application program interface (API) for Microsoft Windows,

introduced in 2001 as a downloadable add-on to Windows 2000 and XP and included in subsequent versions of Windows.

The purpose of the .NET Framework is to reduce the amount of work programmers have to do, while at the same time increasing reliability and introducing Java-like portability.

The .NET Framework is fully object-oriented. The .NET Framework manages the memory used by each

program. Like Java, the .NET Framework normally compiles programs into

bytecode, a concise notation that is converted to machine language when the program is ready to run.

Page 22: Programming lesson1

Bytecode?

Bytecode is the compiled code that compilers for Java and C# produce. It isn't true machine code but a simpler code made up of instructions that are one byte long.