370 likes | 667 Views
Programming. Topic. Design tools Flowchart Pseudocode Programming language Language level Popular programming languages Language translator Assembler Complier Interpreter Demo VB C#. Program.
E N D
Topic • Design tools • Flowchart • Pseudocode • Programming language • Language level • Popular programming languages • Language translator • Assembler • Complier • Interpreter • Demo • VB • C#
Program • A program is a list of instructions that the computer must follow to process data into information. • The instructions consist of statements used in a programming language, such as BASIC.
Programming • Programming is a process for creating a list of instructions.
Terms • Algorithm • Flowchart • Pseudocode • Coding
Algorithm • An algorithm is a formula or set of steps for solving a particular problem. • EX: a recipe for baking bread is an algorithm.
Design Tools Flowchart Pseudocode
Flowchart • Flowchart is a chart that graphically presents the detailed series of steps (algorithm, or logical flow) needed to solve a programming problem. • The flow chart uses standard symbols, called ANSI symbols, after the American National Standards Institute, which developed them.
Pseudocode • It is a method of designing program using normal human-language statements to describe the logic and the processing flow. • It is like an outline or summary form of the program you will write.
Example of Pseudocode START DO WHILE (SO LONG AS) THERE ARE RECORDS Read a customer billing account record IF today’s date is greater than 30 days from date of last customer payment Calculate total amount due Calculate 5% interest on amount due Add interest to total amount due to calculate Grand total Print on invoice overdue amount ELSE Calculate total amount due ENDIF Print out invoice END DO END
Coding • Writing the program is called coding. Coding is what many people think of when they think of programming, although it is only one of the five steps. • Coding consists of translating the logic requirements from pseudocode or flowcharts into a programming language—the letters, numbers, and symbols that make up the program.
To coding • Select the Appropriate Programming Language - A programming language is a set of rules that tells the computer what operations to do. Examples of well-known programming languages are C, C++, and Java. • Follow the Syntax - For a program to work, you have to follow the syntax, the rules of the programming language. Programming languages have their own grammar just as human languages do.
Five Generations • language • language • language • level language • language • Programming language are said to be • when they are closer to the language that the computer itself uses (1,0) • when they are closer to the language people use – more like English, for example.
Language Translator • It is a type of system software that translates a program written in higher level programming language into machine language.
3 Types of Language Translators • Assembler • Compiler • Interpreter
It is a program that translates the assembly language program into machine language.
It is a language-translator program that converts the entire program of a high-level language into machine language
The programming instructions are called the . • The compiler translates it into machine language, which in this case is called the . • The important point here is that the object code can be saved and thus can be executed later (as many times as desired), rather than run right away.
Execute Immediately - An interpreter is a language-translator program that converts each procedural language statement into machine language and executes it IMMEDIATELY, . No is saved, as with the compiler.
Visual Programming • Using a mouse, the programmer drags and drops objects on screen • The objects are arranged to make up the graphical user interface for the program being written • By double-clicking on those objects, the programmer can get into a coding window and write the programs to control the actions and behaviors of those objects • This makes it fast and easy to build prototype user interfaces and get end-user approval before doing a lot of programming
Demo programming Console C# Console VB GUI VB
Find capacity of a box • Problem • Find capacity of a box • Formula • Width * Length * Height
Program Bug • A program bug is an error that causes a program to malfunction. • Debugging is the process of ensuring that a program is free of errors, or bugs.
Types of Error • Syntax error • A syntax error occurs when the programmer has not followed the proper syntax (rules) of the programming language being used. • Logic error • Logic errors, or execution-time errors, stem from a logic problem in the program’s design and are often difficult to detect. • Such an error results when the command syntax is correct but the program produces incorrect results. This may happen if you have written a formula incorrectly