Chapter-1-Introduction-to-ITEPLF.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Chapter 1 Introduction to ITEPLF Presented By: MARK JARUS T. TALANQUINES Assistant Professor II TABLE OF CONTENTS NO: LIST OF TOPICS Topic 1: Introduction ITEPLF Topic 2: Basic Computer Operation Topic 3: History of Computer Programming Topic 4: Programmi...

Chapter 1 Introduction to ITEPLF Presented By: MARK JARUS T. TALANQUINES Assistant Professor II TABLE OF CONTENTS NO: LIST OF TOPICS Topic 1: Introduction ITEPLF Topic 2: Basic Computer Operation Topic 3: History of Computer Programming Topic 4: Programming Errors Topic 5: Program Development Lifecycle Topic 6: Topic 7: Topic 1 Introduction to ITEPLF Introduction to ITEPLF COMPUTER SYSTEM – Combination of all the components required to process and store data using a computer. Every computer system is composed of multiple pieces of hardware and software. Computer Hardware HARDWARE – is the equipment, or the physical devices, associated with a computer. o The devices are manufactured differently for computers of varying sizes for example, large mainframes, laptops, and very small devices embedded into products such as telephones, cars, and thermostats. o However, the types of operations performed by different-sized computers are very similar. Computer Software SOFTWARE – is computer instruction that tell the hardware what to do. It is a program, which are instruction sets written by programmers. You can buy prewritten programs that are stored on a disk or that you download from the Web. o Alternatively, you can write your own programs. When you write software instructions, you are programming. Hardware VS Software Hardware VS Software Physical elements of a computer A collection of instruction that tell or electronic system. the computer how to perform a Has 4 main categories: Input task. Devices, Output Devices, Mainly divided into system Secondary Storage Devices & software and application software. Internal Components. Intangible Tangible Developed by writing instruction Developed using electronic & other using a programming language. materials. When damage it can be reinstall When damaged, it can be using a backup copy. replaced with a new component. Should be installed into the Starts functioning once the computer to function. software is loaded into the system. Software can be classified in 2 broad types: SYSTEM SOFTWARE – performs APPLICATION SOFTWARE – are task necessary to the efficient programs that help solve and meet management of the hardware. It user problems and needs directly. refers to the computer programs or They are designed to perform library files whose purpose is to specific functions. help run the computer system. o Ex. Word Processing, o Ex. OS, Utility Program, Spreadsheet, Multimedia, Translators. Enterprise Software, Programming Software. Application Software Classification 1. COMMERCIAL – comes prepackaged 3. OPEN SOURCE – created by generous and is available from software vendors. programmers and released to the Commercial software must be public domain for free and for public use purchased. 2. SHAREWARE – are developed and released as demonstration version of the commercial product. Each demonstration has an expiration date. Topic 2 Basic Computer Operations Computer System Block Diagram Together, computer hardware and software accomplish four major operations in most programs: o Input o Process o Output o Storage Together, computer hardware and software accomplish four major operations in most programs: 1. INPUT – Data items will enter the computer system and are placed in memory, where they can be processed. Hardware devices that perform input operations include keyboards, mouse, etc. Data items include all the text, numbers, and other raw material that are entered into and processed by a computer. 2. PROCESS/STORAGE – Processing data items may involve organizing or sorting them, checking them for accuracy, or performing calculations with them. The hardware component that performs these types of tasks is the central processing unit, or CPU. The processed data are then stored (temporary/ permanent) 3. OUTPUT – After data items have been processed, the resulting information usually is sent to a printer, monitor, or some other output device so people can view, interpret, and use the results. Programming professionals often use the term data for input items, but use the term information for data that has been processed and output. Topic 3 History of Computer Programming Computer Programming COMPUTER PROGRAMMING – (often shortened to programming or coding) is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. o This source code is written in one or more programming languages (such as Java, C++, C#, Python, etc.). The role of a programming language can be described in two ways: TECHNICAL – It is a means for instructing a Computer to perform tasks. CONCEPTUAL – It is a framework within which we organize our ideas about things and processes. According to the last statement, in programming we deal with two kinds of things: DATA – representing ''objects'' we want to manipulate. PROCEDURES – ''descriptions'' or ''rules'' that define how to manipulate data. Computer Programmer COMPUTER PROGRAMMER – computer programmer, developer, or coder is a person who writes computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software. o A programmer's primary computer language (C, C++, Java, Lisp, Python etc.) is often prefixed to the above titles, and those who work in a Web environment often prefix their titles with Web. o The term programmer can be used to refer to a Software developer, Web Developer, Mobile Applications Developer, Embedded Firmware Developer, Software engineer, Computer Scientist, or Software Analyst. Person’s in Programming Field British countess and mathematician Ada Lovelace is popularly credited as history's first programmer, as she was the first to express an algorithm intended for implementation on a computer, Charles Babbage's analytical engine, in October 1842, intended for the calculation of Bernoulli numbers. Her work never ran because Babbage's machine was never completed to a functioning standard in her time; the first programmer to successfully run a program on a functioning modern electronically based computer was pioneer computer scientist Konrad Zuse, who achieved this feat in 1941. Person’s in Programming Field The ENIAC programming team, consisting of Kay McNulty, Betty Jennings, Betty Snyder, Marlyn Wescoff, Fran Bilas and Ruth Lichterman were the first regularly working programmers. To build programs, people use languages that are similar to human language. The results are translated into machine code, which computers understand. The First Programming Language Even though there’s not a definite answer, Plankalkul, pronounced “Plan Calculus”, is regarded as the world’s first high-level programming language for computers. Created by German engineer Konrad Zuse between 1942 and 1945, the language didn’t receive much attention. The popular languages that followed Plankalkul were Fortran and Lisp. Programming languages fall into three broad categories: 1. Machine Languages 2. Assembly Languages 3. Higher-Level Languages Programming languages fall into three broad categories (con): 1. MACHINE LANGUAGES – (first-generation languages) are the most basic type of computer languages, consisting of strings of numbers the computer's hardware can use. Different types of hardware use different machine code. For example, IBM computers use different machine language than Apple computers. 2. ASSEMBLY LANGUAGES – (second-generation languages) are only somewhat easier to work with than machine languages. To create programs in assembly language, developers use cryptic English-like phrases to represent strings of numbers. The code is then translated into object code, using a translator called an assembler. 3. HIGHER-LEVEL LANGUAGES – Are more powerful than assembly language and allow the programmer to work in a more English-like environment. Higher-level programming languages are divided into three "generations”, each more powerful than the last: Third - generation languages Fourth - generation languages Fifth - generation languages Programming Languages MNEMONICS – is a device such as a pattern of letters, ideas, or associations that assists in remembering something. “ex. WYSIWYG = what you see is what you get“. “ex. PEMDAS = Parenthesis, exponent, multiplication, division, addition, subtraction”. “ex. SOHCAHTOA = Sin(x) = Opp/Hyp, Cos(x) = Adj/Hyp, and Tan(x) = Opp/Adj”. Higher-level programming languages are divided into three "generations”: 1. THIRD-GENERATION LANGUAGES – (3GLs) are the first to use true English-like phrasing, making them easier to use than previous languages. 3GLs are portable, meaning the object code created for one type of system can be translated for use on a different type of system. The following languages are the 3GLs: FORTRAN C COBOL C++ BASIC Java Pascal ActiveX 2. FOURTH-GENERATION LANGUAGES - (4GLs) are even easier to use than 3GLs. 4GLs may use a text-based environment (like a 3GL) or may allow the programmer to work in a visual environment, using graphical tools. The following languages are 4GLs: Visual Basic (VB) Visual C# NetBeans Java Higher-level programming languages are divided into three "generations”: 3. FIFTH-GENERATION LANGUAGES – (5GLs) are an issue of debate in the programming community – some programmers cannot agree that they even exist. These high-level languages would use artificial intelligence to create software, making 5GLs extremely difficult to develop. Solve problems using constraints rather than algorithms, used in Artificial Intelligence Prolog. Language and Elements VOCABULARY – The vocabulary is the set of all the words in the language. Ex. Data Types – A particular kind of data item that is defined by the values it can accept. Ex. Logic – A system or set of principles underlying the arrangements of elements in a computer or electronic device so as to perform a specified task. Ex. Loop – A function that, like and if and else statement, takes a condition and repeats a function or set of functions in the loop until that condition is met. Ex. Machine Code –A computer programming language consisting of binary instructions which a computer can respond to directly. Language and Elements (Con..) SYNTAX – Syntax consists of the rules for combining words into sentences, or statements as they are more usually called in programming language. Other Definition: It refers to the rules and regulations for writing any statement in a programming language like C/C++. It does not have to do anything with the meaning of the statement. A statement is syntactically valid if it follows all the rules. It is related to the grammar and structure of the language. Programming Languages Syntax improves code readability. It ensures that the four C’s of coding are #include maintained: int main() { o Communication o Code integration o Clarity printf( "Hello, World!" ); } Language and Elements (Con..) SEMANTICS – Semantics define the rules for interpreting the meaning of sentences. o It refers to the meaning associated with the statement in a programming language. o It is all about the meaning of the statement which interprets the program easily. o Errors are handled at runtime. Types of Translator A COMPILER is a program that An INTERPRETER is a program reads a high-level program and that reads a high-level program translates it all at once, before and translates the program line- running any of the commands. by-line, alternately reading lines An ASSEMBLER is a type of and carrying out commands. computer program that takes in basic instructions and converts them into a pattern of bits that the computer's processor can use to perform basic operations. The assembler's job is to convert assembly language code into machine code that the computer can then read and execute. Types of Translator Programming errors are called BUGS. o The process of tracking them down and correcting them is called debugging. o There are a three kinds of errors that can occur in a program, and it is useful to distinguish them to track them down more quickly. Syntax Error, Runtime Error, Logic or Semantics Error Topic 4 Programming Errors Programming Errors (Con..) SYNTAX ERROR – This kind of error occurs when we violate a syntax rule. These errors are detected at compile time period. Usually, this is kind of error is easiest to find. RUNTIME ERROR – This kind of error occurs when we ask the computer to do something that is illegal. These errors are detected at runtime. LOGIC OR SEMANTICS ERROR – This are also called as semantic error. It will compile and run without generating error messages, but it will not do the right thing. These errors are very hard to find because the computer can’t detect it. Syntax Errors Errors in the code that occur when the rules of the programming language are not followed. Common Causes: o Misspelled keywords o Missing punctuation (e.g., semicolons, parentheses) o Incorrect use of operators Detection: Usually identified by the compiler or interpreter before the program runs. Runtime Errors Errors that occur during the execution of a program, often causing it to terminate unexpectedly. Common Causes: o Division by zero o Accessing invalid memory locations o Running out of memory Handling Runtime Errors: Often requires the use of error handling mechanisms, such as try-catch blocks. Logical Errors Errors that occur when a program runs without crashing but produces incorrect results. Common Causes: o Flawed logic or algorithms o Incorrect assumptions about the code o Misinterpretation of the problem requirements Detection: More challenging to detect as the program does not terminate; requires thorough testing. Best Practices for Error Reporting Systematic Approach: Follow a step-by-step method to isolate and fix errors. Common Strategies: 1. Code Review: Have another set of eyes examine your code. 2. Breakpoints and Step-through: Use debugging tools to pause and inspect the state of the program. 3. Unit Testing: Write tests for small parts of the code to ensure they work as expected. 4. Reflect on your own debugging strategies. Best Practices for Error Reporting Importance of Clear Error Messages: Why should error messages be user- friendly and informative? Guidelines for Effective Error Reporting: Be concise and clear: Avoid technical jargon that may confuse users. Provide guidance: Suggest possible actions to resolve the error. Log errors: Maintain detailed logs for developers to aid in debugging. Error Logging Tools: Discuss the use of tools like Sentry, Loggly, or built- in logging frameworks. Learning from Mistakes: Postmortem Analysis The Concept of Postmortem Analysis: Understanding what went wrong after a bug has been fixed. Steps for Effective Postmortem: o Gather data: What happened, and what was the impact? o Analyze: Why did the error occur, and how was it resolved? o Learn: What can be done to prevent similar issues in the future? o The Role of Retrospectives: Regular meetings to discuss what went well and what didn't. o How can documenting and sharing the outcomes of postmortems benefit the entire development team? Understanding Program Logic 1. A program with syntax errors cannot be fully translated and cannot execute. 2. A program with no syntax errors is translatable and can execute, but it still might contain logical errors and produce incorrect output as a result. 3. For a program to work properly, you must develop correct logic; that is, you must write program instructions in a specific sequence, you must not leave any instructions out, and you must not add extraneous instructions. 4. Although the syntax of programming languages differs, the same program logic can be expressed in different languages. 5. Most simple computer programs include steps that perform input, processing, and output. 6. Write a computer program to double any number you provide. Topic 5 Program Development Life Cycle Program Development Life Cycle The program development life cycle is a set of steps or phases that are used to develop a program in any programming language. 1. Planning 2. Analysis 3. Design 4. Implementation 5. Test and Integration 6. Maintenance REFERENCES 1. Ritchi, D. M., & Kernighan, B. W. (2021). C programming language (2nd ed.). 2. Gookin, D. (2020). C programming for dummies. John Wiley & Sons. 3. McGrath, M. (2018). C programming in easy steps: Updated for the GNU compiler version 6.3.0 and Windows 10 (5th ed.). In Easy Steps. REFERENCES 4. C programming language tutorial. (2024, June 10). GeeksforGeeks. https://www.geeksforgeeks.org/c- programming-language/?ref=shm 5. W3Schools.com. (n.d.). W3Schools Online Web Tutorials. https://www.w3schools.com/c/index.php 6. C tutorial. (n.d.). Quality Tutorials, Video Courses, and eBooks.https://www.tutorialspoint.com/cprogramming/index. htm The End of Chapter! Email: [email protected] Website: Pending..

Use Quizgecko on...
Browser
Browser