




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Algorithms Flowcharts Algorithm - step by step procedure of solving a problem Flowcharts – It is the graphical representation of the algorithm. Coding- Writing instructions in a particular language to solve a problem. Testing- After writing a program, programmer needs to test the program for completeness, correctness, reliability and maintainability. Maintaining the program- It means periodic review of the programs and modifications based on user requirements.
Problem definition : To find simple interest Problem Analysis : inputs– p, r, t Output– simple interest Algorithm Step 1:Start Step 2:input p,r,t Step 3: calculate si=prt/ Step 4: output si Step 5:stop
Example 1: Calculate the Interest of a Bank Deposit Algorithm:
Example 2: Convert Temperature from Fahrenheit ( ℉ ) to Celsius ( ℃ ) Algorithm: Step 1: Read temperature in Fahrenheit, Step 2: Calculate temperature with formula C=5/9*(F-32), Step 3: Print C, Flowchart:
Example 4: Determine Whether A Student Passed the Exam or Not: Algorithm:
Programming is then the task of describing your design to the computer: teaching it your way of solving the problem. There are usually three stages to writing a program: Coding Compiling Debugging
Compilation is actually the process of turning the program written in some programming language into the instructions made up of 0 's and 1 's that the computer can actually follow. This is necessary because the chip that makes your computer work only understands binary machine code - something that most humans would have a great deal of trouble using since it looks something like: 01110110 01101101 10101111 00110000 00010101 Early programmers actually used to write their programs in that sort of a style - but luckily they soon learnt how to create programs that could take something written in a more understandable language and translate it into this gobbledy gook. These programs are called compilers and you can think of them simply as translators that can read a programming language, translate it and write out the corresponding machine code. Compilers are notoriously pedantic though - if you don't write very correct programs, they will complain. Think of them as the strictest sort of English teacher, who picks you up on every single missing comma, misplaced apostrophe and grammatical error.
This is where debugging makes it first appearance, since once the compiler has looked at your program it is likely to come back to you with a list of mistakes as long as your arm. Don't worry though, as this is perfectly normal - even the most experienced programmers make blunders. Debugging is simply the task of looking at the original program, identifying the mistakes, correcting the code and recompiling it. This cycle of code - > compile - > debug will often be repeated many many times before the compiler is happy with it. Luckily, the compiler never ever gets cross during this process - the programmer on the other hand... It should also be said at this point that it isn't actually necessary to write the entire program before you start to compile and debug it. In most cases it is better to write a small section of the code first, get that to work, and then move on to the next stage. This reduces the amount of code that needs to be debugged each time and generally creates a good feeling of "getting there" as each section is completed. Finally though, the compiler will present you with a program that the computer can run: hopefully, your solution!
Programming language is important because it defines the relationship, semantics and grammar which allows the programmers to effectively communicate with the machines that they program. A programming language serves several purposes: You can instruct the computer what to do in a human-readable form Allows the programmer to structure the instructions into functions, procedures , etc. This also allows the program to be broken into "chunks" which can be developed by a group of developers Provides portability - the low-level instructions of one computer will be different from that of another computer. Computer programmers have a full understanding of the how and why of computer systems, including system limitations, and can set realistic expectations and work around those limitations to fully maximize the use of the equipment and its accessories. Computer programming principles implemented today will likely influence how technologies such as voice- recognition, artificial intelligence and other sophisticated technologies will change in the future and how they will be applied to our day-to-day lives. Programming is important for speeding up the input and output processes in a machine. Programming is important to automate, collect, manage, calculate, analyze the processing of data and information accurately.