ICT 104 Lecture 1 Introduction to Programming.pdf
Document Details
Uploaded by SupplePlot
Tags
Full Transcript
07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS Lecture #1...
07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS Lecture #1 Introduction to Programming PROF. ATTO L. TABUGA RL. MLIS 1 ICT 104 PROGRAMMING FUNDAMENTALS II. Introduction “Computers are intelligent? ” Answers? ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 2 1 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS V. Discussion “Computers are really intelligent? ” Computers are not intelligent Yes, computers are fast; they are able to calculate complex computations in mere seconds. However, being fast does not make computers intelligent. It only makes them high-speed followers, nothing more. Computers are only as good as the instructions or programs you feed them. As the programmer, it is entirely up to you whether you want the computer to “act intelligently” or not. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 3 ICT 104 PROGRAMMING FUNDAMENTALS I. Definition “Programming” is the art and science of creating computer program. A program being list of instructions that the computer must follow in order to process data into information. (A.Peñoflorida) Computers are rigorously logical machines, and programming requires a similarly logical approach to; - Designing (graphics/arts) - Coding (writing) - Testing and debugging (eliminating errors) ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 4 2 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS “Script code" in the browser generally refers to code written in JavaScript. JavaScript is a programming language used to create interactive effects and dynamic functionality on websites. http://rizalls.lib.admu.edu.ph/#section=home 5 ICT 104 PROGRAMMING FUNDAMENTALS JavaScript is a versatile language with many capabilities, and it’s fundamental for modern web development, enabling dynamic and interactive user experiences. https://www.thisisbeyond.com/ 6 3 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS V. Discussion “Computers are intelligent? In the context of AI” In the context of artificial intelligence (AI), the concept of "intelligence" takes on a more nuanced meaning compared to traditional computing. Traditional Computers: As we mentioned, traditional computers execute instructions and perform calculations very quickly. They follow the rules and logic defined by their programs, but they don’t truly understand or reason about the tasks they’re performing. Artificial Intelligence: AI introduces a different kind of capability. While traditional computers rely on explicit instructions, AI systems use data and algorithms to learn from experience. This learning process allows them to perform tasks that might seem "intelligent" or "adaptive." ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 7 ICT 104 PROGRAMMING FUNDAMENTALS I. Introduction “Why Learn Programming? ” Benefits of knowing how to code: 1. By learning a little programming, you will become familiar with the process of developing software, which can help you work more effectively with software developers. You'll also be able to decide if you want to continue learning programming. 2. Once you have a basic knowledge of programming, you will be able to create small scripts to automate certain tasks. You will be able to use other code within projects without having to write too much of your own code. 3. Once you have more experience, you can then build your own projects, or get a programming job or internship. You can also use your programming skills in most other fields Retrieved from: https://en.wikipedia.org/wiki/Information_Age ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 8 4 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS I. Introduction “Why Learn Programming? ” These are some things you can do with basic programming knowledge: Create a simple website and embed other scripts in it to do all sorts of things Work with Macros in Microsoft Office or AppsScripts in Google Docs. Manipulate large amounts of text automatically. Create simple scripts to calculate things in math, science or business ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 9 ICT 104 PROGRAMMING FUNDAMENTALS I. Introduction Program Development Process You might think that programming is simply typing words and numbers onto a computer. Actually this activity, called coding, is only a small part of the whole programming process. Programming, also called software engineering, is a multistep process for creating programs. As programming provides you with unique opportunity to think, express ideas, and learn the fundamental process of problem-solving, you will learn how to think of what we called critical thinking. Basically, programming is a method of solving a problem. Programming uses algorithms – an algorithm being a set of ordered steps for solving a problem and which is essentially synonymous with logic. So an analytical, logical, and critical thinking are needed in the formulation of solutions to a problem. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 10 5 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 11 ICT 104 PROGRAMMING FUNDAMENTALS 12 6 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 13 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 1: Problem Analysis Step 2: Problem Design Step 3: Problem Coding Step 4: Program Testing, Running and Debugging Step 5: Documentation and Maintenance ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 14 7 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 1: Problem Analysis Problem analysis is defined as the methodical investigation of a problem and the separation of the problems into smaller related units for further detailed study. (ANSI) Problem analysis requires performing the following steps: 1. Define the problem and the users 2. Determine the desired outputs 3. Determine the desired inputs 4. Determine the desired processing 5. Double-check the feasibility of implementing the program 6. Document the analysis ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 15 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 2: Program Design The program design process describes the algorithm for the solution of the problem. Algorithms specify what actions and operations a program will take. A programmer has several program design tools to choose from – flowcharts, decision tables or pseudocodes – in formulating an algorithm Program design requires performing the following steps: 1. Determine the program logic using a top-down approach and modularization. 2. Design details using pseudocode and / or flowcharts 3. Do a structured walkthrough ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 16 8 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 2: Program Design Program design requires performing the following steps: 1. Determine the program logic using a top-down approach and modularization. Example: ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 17 18 9 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 2: Program Design Program design requires performing the following steps: 2. Design details using pseudocode and / or flowcharts. Example of pseudocode ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 19 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 2: Program Design Program design requires performing the following steps: 2. Design details using pseudocode and / or flowcharts. Example of flowcharts: ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 20 10 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 2: Program Design Program design requires performing the following steps: 3. Do a structured walkthrough This time you have to thoroughly reviewing and editing your program and pointout some things you missed. You will examining a computer system, design and implementation. It systematically reviewed in order to minimized the error rate of the software under development. Being in this process you have to cooperative endeavor. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 21 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 3: Program Coding Program coding requires performing the following steps: 1. Select the appropriate programming language A programming language is a language used to write instructions for the computer. Not all languages are appropriate for all uses. So you have to think and considerations as: - What purpose the program is designed to serve - What languages are already being in the organization or field you are in ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 22 11 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem- solving process in Programming Timeline in the Development of Programming Languages ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 23 ICT 104 PROGRAMMING FUNDAMENTALS Approximate Generation Description Examples Timeframe Machine Language: Binary code directly executed by hardware; 1st Generation 1945 - very specific to the machine's architecture. Assembly Language: Uses symbolic representations of machine Assembly language 2nd Generation Mid 1950s code instructions; closer to human-readable format. (e.g., MASM, NASM) High-Level Languages: Abstracts hardware details; includes Visual Basic, C, COBOL, 3rd Generation Early 1960s features like variables and control structures. Pascal Very High-Level Languages: Closer to human language; focuses 4th Generation Early 1970s on problem-solving and productivity; includes database NOMAD, FOCUS, SQL querying. Natural Languages: Allows programming through natural 5th Generation Early 1980s language-like syntax; aims to be more accessible to non- Prolog, LISP programmers. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 24 12 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS III. List of Programming Languages There are 256 + programming languages ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 25 ICT 104 PROGRAMMING FUNDAMENTALS II. List of Programming Languages 14 Programming Languages 1. C -The great-grandmother and lingua franca of all programming languages, C was first released in 1972 – that’s a whopping 45 years ago. - C has had a strong influence on several other programming languages. These include C# and C++, Java, JavaScript, PHP, and Python, for instance. - However, C is not well suited for mobile devices like some of the other languages are. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 26 13 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 2. C# -Originally developed by Microsoft to run on their.NET framework, C# (pronounced C-sharp) is based on C and C++. Clearly, it’s main use these days is building Microsoft software. - It’s a high-level language, meaning that it reads a bit like English. - However, it’s still not as high-level as Python, for example – and therefore not quite as easy for a beginner to learn. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 27 ICT 104 PROGRAMMING FUNDAMENTALS 3. C++ C++ - C++ is also based on C, the indisputable dinosaur of programming languages still commonly used. - It’s a powerful, high-performance language, but rather lower-level. - You can create computer software, mobile apps, game engines and games, or web applications with it. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 28 14 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 4. CSS CSS - CSS or Cascading Style Sheets is the language used for making websites look pretty. - Since the visual aspect of any website is crucial to get right these days, learning CSS is a must for anyone interested in web development. CSS takes those elements and tells how they should look. - one could point out that CSS is just a style sheet language and not a “proper” programming language. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 29 ICT 104 PROGRAMMING FUNDAMENTALS 30 15 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 31 ICT 104 PROGRAMMING FUNDAMENTALS 5. HTML - HyperText Markup Language or HTML is used to creating structured content for all websites out there. Rather a markup language than a “proper” programming language, HTML defines the different elements on a web page. - It tells which parts are headers, which ones are links, text paragraphs, or images, for instance. In other words, HTML is the mother of all web development languages. - In short, everything you see on a specific website gets its fundamental characteristics from the HTML code written by a web developer ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 32 16 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 6. JAVA - Java is definitely one of the most popular programming languages in the world. It’s used for a variety of different purposes, ranging from Android smartphone apps to complete computer applications. - The fundamentals of Java actually stem from C++, taking them a bit further and making the language easier to use. - In other words, Java is very popular across all platforms, operating systems, and devices due to its versatility and flexibility ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 33 ICT 104 PROGRAMMING FUNDAMENTALS 7. JAVASCRIPT - Not to be confused with Java, JavaScript is the programming language of the Web. It breathes life into websites, making them more interactive, interesting to use, and user-friendly. - Different frameworks and libraries – such as AngularJS and jQuery or React, respectively – make using JavaScript for front-end development even more efficient and interesting. - JavaScript is a client-side language itself, meaning that the code is executed on the user’s browser. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 34 17 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 8. Objective-C - Objetive-C is the primary language by Apple for developing programs for Mac OS X and iOS. First developed in the ’80s, it gained popularity along the iOS. - It’s a very powerful and flexible language, based on the C language. However, it’s received some criticism for being somewhat difficult to learn for beginners. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 35 ICT 104 PROGRAMMING FUNDAMENTALS 9. PERL - Perl is a high-level scripting language that first appeared in 1987 and has since developed into a small family of two separate languages, Perl 5 and Perl 6.. - It was originally developed for text processing and manipulation, but has since found further applications ranging from web development to system administration. - a powerful tool that can be used on practically every operating system on the planet. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 36 18 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 10. PHP - PHP or Personal Home Page is a scripting language running on the server side used to create web pages written in HTML. - It was originally created to be a toolset to help its creator, Rasmus Lerdorf, maintain his Personal Home Page (PHP). That aside, PHP has since become one of the most popular scripting languages on the Web. - PHP can do things such as creating login pages, photo galleries, discussion forums, and much more. Websites employing PHP include some lovely treats we all are familiar with, like WordPress, Facebook, and Tumblr. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 37 ICT 104 PROGRAMMING FUNDAMENTALS 11. PYTHON - Python is definitely one of the most versatile programming language with its diverse applications. - There are lots of useful libraries created for Python facilitating its use in the academic and educational fields, such as matplotlib, pandas, and pyGal. - Python is one of the best suited programming languages for beginners. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 38 19 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 12. RUBY - Ruby is a very high-level, multi-purpose programming language first released in 1995. It’s definitely one of the most fun languages to work with and in fact, that was one of the initial goals when the language was developed. - Ruby is flexible when it comes to solving a specific problem. There will usually be more than one “best” way for finding a good solution for it. - Learning Ruby will definitely reward you with a steep learning curve and seeing results fairly quickly. For instance, you can build a web application from scratch surprisingly fast using the Ruby on Rails framework. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 39 ICT 104 PROGRAMMING FUNDAMENTALS 13. SQL - SQL or Structured Query Language is used for working with data stored in Relational Database Management Systems (RDBMS). - Even if you are not aiming at becoming a data analyst yourself, basic SQL skills will be an advantage in terms of being aware of the possibilities data mining offers. - Anyone interested in data analysis should learn SQL. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 40 20 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS 14. SWIFT - Back in 2014, Apple developed their own programming language now known as Swift. Before that, the de facto language for iOS development was Objective-C. - Considering the huge demand in the mobile app market, it was no surprise that Swift quickly became very popular. It scales nicely and it’s fast. ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 41 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 4: Program Testing Program testing involves running various tests, such as; Alpha test which is desk-checking and debugging. The process of user testing that is carried out on a piece of alpha software Alpha a software product that is under development and has enough functionality to begin testing. It is usually unstable. Beta test a test usually one of the last testing of the software that is still under development accomplished by beta testers and report any operational or utilization errors and bugs found. Closed-Beta test(CBT test) in which a final testing will be implemented in an amount of time. Open-Beta test(OBT test) a time for implementing the software functions, fully operational but with rigid examining for maybe data errors and delays and some other problems encounter. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 42 21 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS Step 4: Program Testing Program testing requires performing the following steps: 1. Perform desk-checking Desk-checking is simply reading through, or manually testing, the solution design to make sure that it is free of errors and that the logic works, its like proof-reading before the program is actually run. 2. Debug the program Errors will probably surface which called bugs. To debug means to detect, locate, and remove all errors in a computer program. There are 3 type of common errors: 1. Syntax error 2. Run-time error 3. Logic error ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 43 ICT 104 PROGRAMMING FUNDAMENTALS There are 3 type of common errors: 1. Syntax error - most common error in programming like caused by typographical errors such as misspelled words and incorrect symbols, punctuations and unmatched parentheses. 2. Run-time error - is a software error that occurs while a program is being executed as detected by a compiler or other supervisory programs. 3. Logic error - are caused by incorrect use of control structures. These errors are difficult to detect than syntax error. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 44 22 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS Step 4: Program Testing Program testing requires performing the following steps: 3. Run real data After desk-checking and debugging, the program then needs to be tested with real data, from beta-testing until CBT and final product to OBT. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 45 ICT 104 PROGRAMMING FUNDAMENTALS II. Procedural Steps in Problem-solving process in Programming Step 5: Program Documentation and Maintenance Documentation is the set of instructions shipped with a programs or a piece of hardware. It usually includes necessary instructions on the use and maintenance of the product. It is not end of the stage process it need throughout operational observation with the help of computer operators, users, and programmers. Program Documentation and Maintenance requires performing the following steps: 1. Prepare user documentation The printed, on-disk or online manuals in commercial software packages are user documentation which can help nonprogrammers use the software. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 46 23 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS Step 5: Program Documentation and Maintenance Program Documentation and Maintenance requires performing the following steps: 2. Prepare operator documentation The people who run large computers are called computer operators. They are not necessarily programmer, hence they also need information (the documentation) on what to do when the program malfunctions. 3. Prepare programmer documentation Program documentation consists of written, graphics, and electronic descriptions of what a program is and how to use it. It help reduces effort on program maintenance and major program overhaul. 4. Maintain the program Maintenance is any activity design to keep programs error-free, up-to-date, and in good working condition. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 47 ICT 104 PROGRAMMING FUNDAMENTALS IV. Definitions Algorithms – a finite sequence of steps for solving a logical or mathematical problem or performing task. Logic - a theory of reasoning Module - a standalone routine which usually performs a specific functions, such as accepting data input or printing a report. Top – Down design - a program design methodology that starts with defining program functionality at the highest level (a series of tasks) and then breaks down each task into lower-level tasks and so on. Retrieved from: https://en.wikipedia.org/wiki/Information_Age ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 48 24 07/08/2024 ICT 104 PROGRAMMING FUNDAMENTALS V. Discussion “Are computers intelligent? ” What is Intelligence? Intelligence is the ability to learn, understand, and make decisions. For example, humans can: - Learn new things every day. - Understand complex ideas. - Make choices based on what they know and feel. How Do Computers Work? Computers work differently from our brains. They follow instructions given to them by humans. These instructions are called "programs" or "software." Here’s what computers do: - Follow Rules: Computers follow a set of rules or commands given to them by programmers. - Process Data: They can process huge amounts of data very fast. - Perform Tasks: They can perform specific tasks like calculations or running games. Can Computers Learn? Some computers can learn in a way. This is called "Artificial Intelligence" (AI). AI can: - Recognize Patterns: Like finding a cat in a picture. - Improve Over Time: AI can get better at tasks with more data, like getting better at playing a game. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 49 ICT 104 PROGRAMMING FUNDAMENTALS V. Discussion “Are computers intelligent? ” Differences Between Human and Computer Intelligence 1. Emotions: Humans have feelings and emotions, but computers do not. They don’t feel happy, sad, or excited. 2. Creativity: Humans can be creative, writing stories, drawing pictures, and coming up with new ideas. Computers can only create what they are programmed to. 3. Decision Making: Humans make decisions based on experiences and emotions. Computers make decisions based on data and instructions. While computers can do many things and even learn to some extent, they do not have the kind of intelligence that humans do. They are powerful tools that help us, but they don't think or feel like we do. Computers follow instructions and can get better at tasks, but they are not truly "intelligent" in the way humans are. ICT 104 PROGRAMMING FUNDAMENTALS PROF. ATTO L. TABUGA 50 25 07/08/2024 Work Cited: Cousyn, M., Vizcarra, B., & Fernandez, P. “Understanding Structured Programming” Manila : Vibal Publishing House. (20--) Mitchell, A. S. “Online with Computers”. London: Charles Baker Books. (20--) Links https://www.learneroo.com/modules/12/nodes/93 https://mikkegoes.com/14-programming-languages-explained/ Images: http://s1.dmcdn.net/DNzaK/1280x720-sHa.jpg http://omexpert.com/wp-content/uploads/2016/01/most-usable-programing-lanuages1.jpg https://www.w3.org/html/logo/downloads/HTML5_Logo_512.png https://modeling-languages.com/wp-content/uploads/2014/07/256px-JavaScript-logo.png http://ffried.codes/content/images/2015/03/Icon.png https://botw-pd.s3.amazonaws.com/styles/logo-thumbnail/s3/0005/0575/brand.gif?itok=MdHyXm-x http://www.sqltraininginchennai.com/wp-content/uploads/2016/02/SQL-course-in-Chennai.png https://inceptivetechnologies.com/wp-content/uploads/2014/10/swift.png http://www.csfieldguide.org.nz/en/images/computer-studying-turing-test.png ICT 103 – DIGITAL LIBRARIES AND RESOURCES PROF. ATTO L. TABUGA 51 26