Presentations to programming lessons on Pascal ABC. Presentation on the topic: Pascal ABC programming environment. Erect

Slide 2.

Structure of the program

The program in the Pascal ABC language has the following form: Program Name of the program; Connection section Connectivity DescriptionsBegin OperatorsEnd. The first line is called the heading of the program and is not mandatory. The module connections section begins with the Uses serviceword, followed by a list of modules listed through commas. The descriptions section may include sections of the description of variables, constants, types, procedures and functions that follow each other in an arbitrary order. The module connection section and the descriptions section may be absent. Operators are separated by one from another "point with a comma" symbol.

Slide 3.

program Name of the program; Uses section Connection ModuleVar section DescriptionsBegin OperatorsEnd.

Slide 4.

Program - program; Uses - use; Var- Description; Begin - the beginning; End - End.

Slide 5.

Slide 6.

Slide 7.

Slide 8.

Slide 9.

Slide 10.

Slide 11.

Slide 12.

The USEs command - use, opens in a separate window

  • Slide 13.

    We will write our first program: we will give our program the name must be written in Latin letters, and should not begin with the numbers. Each operator ends -; Write is a command output command in the viewing window.

    Slide 14.

    Task 1.

    Withdraw the greeting on the screen: "Good day." PROGRAMPRIML; (Optional Program element of this Prim1 program (we note that there should be no spaces in the program name, it should start with the letter, consist only of Latin letters, numbers and some characters, not allowed by the use of point and semicolons). The descriptive part does not , And immediately goes the section of the operators starting from the BEGIN service word in Turbopascal 7.0, after which the language operator goes) begin ("Good day"); (at the end of the program in Turbopascal 7.0, the End.) END is installed.

    Slide 15.

    Program Priml; Begin Writeln ("Good day"); End.

    Slide 16.

    Task 2. Invoice from the keyboard value of the variable N

    program Inp; Uses CRT; VAR N: Integer; beginclrscr; Write ("Enter a number from the keyboard:"); readln (n); (Here the program will pause and will expect input from the keyboard. Dial the number on the keyboard, for example 153, and press the Enter key) writeln ("BY entered the number", N); readln (this is an empty input operator. Here the program will again suspend and will wait to press the ENTER key. During this time you have time to view the output on the screen.) End.

    Slide 17.

    pROGRAMINP; UseSCRT; VAR N: Integer; beginclrscr; Write ("Enter a number from the keyboard:"); readln (n); Writeln ("BY introduced the number", N); readln end.

    Slide 18.

    Calculation of body speed when falling from the tower

    Program PIZA; Const (this is a section of the description of the constant. It is in front of the VAR) section G \u003d 9.8; (The Constant Type is determined automatically, on the form of the number of numbers. In this case, due to the presence of a decimal point, this type is REAL) VAR V, H: REAL; Begin Write ("Enter the height of the tower:"); readln (h); V: \u003d SQRT (2 * G * H); Writeln ("Fall Speed", V: 6: 3): (so that the text and the number do not "stick", after the text inside the apostrophes, a space is added) readln end.

    Slide 19.

    PROGRAMPIZA; constcrt; G \u003d 9.8; VAR V, H, N: REAL; Begin CLRSCR; Write ("Enter the height of the tower:"); readln (h); V: \u003d SQRT (2 * G * H); Writeln ("Fall Speed", V: 6: 3): Readlnend. CRT, CLRSCR; - Cleaning the screen

    Slide 20.

    Slide 21.

    Pascal ABC system

    The Pascal ABC system is designed to teach programming in Pascal and is focused on schoolchildren and junior students. According to the authors, initial programming training should take place in fairly simple and friendly environments, while these environments should be close to the standard programming language capabilities and have enough rich and modern libraries of standard subroutines. Language Pascal is recognized by many Russian teachers as one of the best for primary learning. However, the BorlandPascal environment, focused on MS DOS, is outdated, and BorlandDelphi Wednesday with its rich opportunities is difficult for a beginner programmer. So, an attempt to start learning from writing an event program to BorlandDelphi causes a traceable mass of difficulties and leads to a number of incorrectly formed skills. The Pascal ABC system is based on the Delphipascal language and is designed to make a gradual transition from the simplest programs to a modular, object-oriented, event and component programming. Some language structures in Pascal ABC are allowed, along with the main, simplified use, which allows them to use them in the early stages of training. For example, in modules there may be no separation to the interface section and the implementation section. In this case, the modules are arranged almost the same as the main program, which makes it possible to start studying them in parallel with the theme "procedures and functions". The body of the methods can be determined directly inside the classes (in the style of Java and C #), which allows you to create classes almost immediately after studying records, procedures and functions. A number of Pascal ABC programming system modules are specifically created for training purposes: Graphabc raster graphics module costs without objects, although its ability to practically coincide with BorlandDelphi's graphic features. It is available in disaster programs and makes it easy to create an animation without flicker. The Events module allows you to create the simplest event programs without using objects (events are conventional procedural variables). Timers and Sounds modules allow you to create timers and sounds that are also implemented in procedural style. These modules can be used even in console programs. Containers container classes module allows you to work with basic data structures (dynamic arrays, stacks, queues, sets) implemented as classes. ABCObjects vector graphics module is designed to quickly explore the foundations of object-oriented programming, and also allows you to create sufficiently complex game and training programs. VCL visual components module allows you to create event applications with the main form in the style of Delphi. VCL classes are slightly simplified compared to similar class Delphi. There is a form editor and an object inspector. Form recovery technology on the program code allows you to do for an application with the main form by one file (!). The Pascal ABC language has arithmetic operations with typed pointers (in Language C), as well as the type of Complex designed to work with complex numbers. The Pascal ABC compiler is the foreground compiler (Front-End). This means that it does not generate executable code in the form.exe file, and as a result of compilation, the program tree in memory, which is then executed using the built-in interpreter. As a result, the speed of the program is about 20 times slower than the speed of the same program compiled in the BorlandPascal environment, and 50 times slower than this program compiled in the BorlandDelphi medium. In the Pascal ABC system, the student can perform the so-called verifiable tasks, ensuring the task formulation with random source data, control of I / O operations, verify the correctness of the decision, as well as the maintenance of the task solving protocol. The tasks are implemented as an electronic ProgrammingTaskBook programming task, containing 1000 tasks for programming a different level of complexity (from the simplest tasks to tasks to files, pointers, and recursion) as well as in the form of performers, the robot and drawers designed to quickly study the basics of programming students of junior and middle classes. In the Free Pascal ABC & ProgrammingTaskBookMiniedition version, a mini version of the electronic task (200 tasks) and a trimmed set of tasks for the robot performers and a drawer are included. PASCAL ABC & PROGRAMINGTASKBOOKCOMPLETEEDITION version contains a complete set of tasks.


    Niklaus Wirth In the early 1970s of the 20th century, Swiss scientist Niklaus Wirth developed a programming language, and gave him the name Pascal, in honor of the famous French mathematics of the XVII century, the inventor of the first billboard of the Blaise Pascal. With the help of Pascal, you can develop programs of the most detailed destination. The syntax of this language is intuitive even to those who are just starting to master the basics of programming.




    The alphabet of the language is the capital and lowercase letters of the Latin alphabet from A to Z, as well as the symbol of the underscore (_), which is also considered the letter. Capital and lowercase letters are interchangeable (equivalent); Arabic numerals; Special single signs: + - * / \u003d.,:; ^ $ Special paired signs: () (); Composite signs: \u003d .. (* *) (..).








    Program NameProgram program structure; (Program title) Uses ...; (module connection section) Label ...; (Section of the labels) Const ...; (Constant description section) Tour ...; (type definition) var ...; (variable descriptions) Function ...; Procedure ...; (Function descriptions and procedures section) Begin ... (Operator) END.











    Arithmetic actions If you write: writeln in the program: Writeln (3 + 8); After executing the program, 3 + 8 appears in the execution screen if you write: writeln (3 + 8); // Without apostrophes, then after executing the program, an inscription 11 will appear in the execution screen, i.e. Pascal will produce the calculation itself Try calculating the expression: 185 (14 + 16)

    To enjoy previewing presentations, create yourself an account (account) Google and log in to it: https://accounts.google.com


    Signatures for slides:

    Programming Language ABC Pascal Grade 9

    Programming language is a formal sign system (a set of commands), which the computer understands. The alphabet of the language is a lot of characters used in this Yap.

    In the early 70s of the 20th century, the Swiss scientist Niklaus Wirth developed the programming language, and gave him the name Pascal, in honor of the famous French mathematics of the XVII century, the inventor of the first billboard of Pascal's blaze. With the help of Pascal, you can develop programs of the most detailed destination. The syntax of this language is intuitive even to those who are just starting to master the basics of programming.

    Language Pascal is convenient for initial programming training, not only because it teaches how to write a program correctly, but also how to properly develop methods for solving programming problems

    The alphabet of the language is the capital and lowercase letters of the Latin alphabet from A to Z, as well as the symbol of the underscore (_), which is also considered the letter. Capital and lowercase letters are interchangeable (equivalent); Arabic numbers 0 1 2 3 4 5 6 7 8 9; Special single signs: + - * / \u003d. ,:; ^ $ # @; Special paired signs: () (); Composite signs: \u003d .. (* *) (..).

    Program structure The program in Pascal language consists of: // Title (optional) // Description block // Body program

    Block descriptions Description of labels; Definition of constants; Definition of types; Description of variables; Description of procedures and functions.

    BOGIN Body ............ (program body, command list) END.

    Program NameProgram program structure; (program title) Uses ...; (module connection section) Label ...; (Section of the labels) Const ...; (Constant description section) Tour ...; (type definition) var ...; (variable descriptions) Function ...; Procedure ...; (Function descriptions and procedures section) Begin ... (Operator) END.

    Explanations in explanations you can use Russian letters (may be in curly brackets) // can be written after two slash

    Output operator WRITE ('Text'); - Output operator text and variables on the screen (leaves the cursor on the current line); Writeln ('Text'); - Output operator text and variables on the screen (transfers the cursor to the new line);

    Compilation (F9) Troubleshooting program errors.

    An example of the Begin Write program ('This is my first program!'); End. Make a compilation and run the program to execute Review the result.

    Program The result of execution stop executing the program

    Task 001 Display the following text on the screen: Hello everyone! I am the best programmer OSH №3! Note that the text is displayed in two different lines.

    Arithmetic actions If you write: writeln in the program: Writeln ('3 + 8'); After executing the program, 3 + 8 appears in the execution screen if you write: writeln (3 + 8); // Without apostrophes, then after executing the program, an inscription 11 will appear in the execution screen, i.e. Pascal will produce the calculation itself Try calculating the expression: 185 (14 + 16)


    1 Slide

    Pascal Belyakova Natalya Aleksandrovna Teacher of Informatics, Technology and IRS, MBOU SOSH No. 6 Cholmsk Sakhalin Region Pascal ABC

    2 Slide

    3 Slide

    Real data type If the number has a comma and is fractional, then it is called real. For storage of real numbers in Pascal, a special data type is used - Real. To enter them, the program is used by the VARIBLE operator (VARIABLE - variable) Example: Program P15; VAR A, B, C: REAL; Begin and so on ..........

    4 Slide

    Real variables: Program Summa; VAR A, B, C: REAL; Begin A: \u003d 3.5; B: \u003d 7.6; C: \u003d a + in; Writeln ("Cumma \u003d", c); End. ____________________________________ All real numbers are recorded not with a comma, but with a point !!!

    5 Slide

    Recruitment variables recording formats: Conventional shape: 0.7 can be recorded as 0.7 or. 7 -2.1 can be written as -2.1 Record with an exponential: a number is represented as a mantissa (fractional part of the number) multiplied by 10 to some extent 2700 \u003d 2.7 * 10 Number 10 is written in the form of the letter E, and the value of the degree is followed by: 2.7E3 0.002 \u003d 2 * 10 The number 10 is written in the form of the letter E, and the value of the degree: 2E-3 3 - 3

    6 Slide

    Real variables: Program Z16; VAR A, B, C: REAL; Begin A: \u003d 17.3; B: \u003d 3.4; C: \u003d A + B; Writeln ("addition A + B \u003d", C); C: \u003d A-B; Writeln ("subtraction a-B \u003d", c); C: \u003d A * B; writeln ("Multiplying A * B \u003d", C); C: \u003d A / B; Writeln ("division a / B \u003d", c); End.

    7 Slide

    Real type functions: Program Z18; VAR A, B: REAL; Begin A: \u003d 2.0; (calculating the square root) B: \u003d SQRT (A); Writeln (square root (sqrt (a)) \u003d ", c); (calculating sine) b: \u003d sin (a); Writeln ('sinus of numbers (sin (a) \u003d", b); (cosine calculation) B: \u003d COS (A); Writeln ('Cosine numbers (COS (A) \u003d ", B);

    8 Slide

    (ARCTANGENS computing) B: \u003d Arctan (A); Writeln (Arctannce of the number (arctan (a)) \u003d ", c); (calculating the logarithm) b: \u003d ln (a); Writeln ('logarithm number (ln (a) \u003d", b); (erection A) b: \u003d exp (a); writeln ('exhibitor to degree A (exp (a) \u003d ", b); (calculating the number PI) b: \u003d pi; writeln (' number pi (pi) \u003d", b ); End.

    9 Slide

    (ARCTANGENS computing) B: \u003d Arctan (A); Writeln ('Arcthangence of the number (arctan (a)) \u003d ", c); _______________________________ The output of the real number can be set. Under the value of the variable" in ", set 6 digits, of which 4 of them after the comma: (Calculation of Arctangen) B: \u003d Arctan (A ); Writeln ('Arcthangence of the number (arctan (a)) \u003d ", in: 6: 4); _______________________________

    10 Slide

    Basic system operators: Program's name Beginning and end beginnieend. Variables VAR whole integer integer real number Real output WRITE navel ('x \u003d', x) display on screen from a new Writeln string ('x \u003d', x) ABS number module (x) Construction of the SQR (x) Square root SIN (X) SINUS NUMBER SIN (X) COSINUS COS (X) number of Arctan (x) Arctan (x) logarithms LN (X) logarithm EXP (X) EXP (X) EXP (X) Calculation of Nutrition PI

    11 Slide

    Task: z15) Considering that the multiplication operation and the construction operation in the square have the same complexity, record the optimal expressions: Z15A) Z15B) Z15C) Z15D) Z15E) Z16) to type the task for the main arithmetic operations (sample in the notebook) Z17) Calculate the expression : Z18) Score a task to calculate the standard functions of the number D: \u003d 8 (module, square root, square of the number, sinus, cosine, tangent, arctangent, catangent, logarithm) Z19) Write a program to calculate the discriminant of a square equation. Specify the coefficients in the program via the assignment operator Z20) Calculate the expression:

    12 Slide

    Z21) Dan diameter of the circle d. Find its length () z22) is given long Cuba rib, a, b, c rectangular parallelepiped. Find its volume and surface area Z23) Find the circumference length L and the area of \u200b\u200bthe circle S of a given radius R: L \u003d 2πR, S \u003d πR Z24) 2 numbers a and b are given. Find their arithmetic averages Z25) There are 2 non-negative numbers a and b. Find their average geometric (square root from their work) Z26) Find the distance between two points with specified coordinates x1 and x2 on the numeric axis: | x2 - x1 |. 2.

    13 Slide

    Literature: M. E. Abramyan. Programming Taskbook. Electronic programming task. Version 4.6./ Rostov-on-Don - 2007 2. Ushakov D.M., Yurkova TA. Pascal for schoolchildren. St. Petersburg: Peter, 2010. - 256 p.