ITCOM 1 chapter 1_8980318d50b43321f8650bc948eaabef.pdf
Document Details
Uploaded by Deleted User
Full Transcript
Chapter 1: Introduction to Computer Science What is computer science? Computer science, the study of computers and computing, including their theoretical and algorithmic foundations, hardware and software, and their uses for processing information. The discipline of computer science includes the stu...
Chapter 1: Introduction to Computer Science What is computer science? Computer science, the study of computers and computing, including their theoretical and algorithmic foundations, hardware and software, and their uses for processing information. The discipline of computer science includes the study of algorithms and data structures, computer and network design, modeling data and information processes, and artificial intelligence. Computer science draws some of its foundations from mathematics and engineering and therefore incorporates techniques from areas such as queueing theory, probability and statistics, and electronic circuit design. Computer science also makes heavy use of hypothesis testing and experimentation during the conceptualization, design, measurement, and refinement of new algorithms, information structures, and computer architectures. Computer science is considered as part of a family of five separate yet interrelated disciplines: computer engineering, computer science, information systems, information technology, and software engineering. This family has come to be known collectively as the discipline of computing. These five disciplines are interrelated in the sense that computing is their object of study, but they are separate since each has its own research perspective and curricular focus. (Since 1991 the Association for Computing Machinery [ACM], the IEEE Computer Society [IEEE-CS], and the Association for Information Systems [AIS] have collaborated to develop and update the taxonomy of these five interrelated disciplines and the guidelines that educational institutions worldwide use for their undergraduate, graduate, and research programs.) The major subfields of computer science include the traditional study of computer architecture, programming languages, and software development. However, they also include computational science (the use of algorithmic techniques for modeling scientific data), graphics and visualization, human-computer interaction, databases and information systems, networks, and the social and professional issues that are unique to the practice of computer science. As may be evident, some of these subfields overlap in their activities with other modern fields, such as bioinformatics and computational chemistry. These overlaps are the consequence of a tendency among computer scientists to recognize and act upon their field’s many interdisciplinary connections. Computer science disciplines As a computer science student, you can choose a major that best meets your interests and career goals. Whether your goal is to work as a computer programmer or your interest is in software development, a degree in computer science will provide you with the foundation needed to enter the workforce. Some areas of computer science include: Software development: As a software developer, your job will be to design computer applications. Most positions require a bachelor’s degree. Computer programming: Computer programmers write code for software programs and applications and test them for functionality. Network systems administration: In this role, you’ll oversee the day-to-day operation of computer networks. Hardware engineering: If you’re interested in designing computer parts, you may want to pursue a career as a hardware engineer. Video game design: If you enjoy working with a team of creative people, you may be interested in a career as a video game designer. Your role will be to design games for computers and other electronic devices. Computer science jobs You may want to enter one of the more common fields when exploring potential computer science careers. Among them are UX design, web development, and mobile app development. Computer hardware and software engineers are among the customary positions for computer scientists. You may also find yourself working in other fields, such as: AI Engineer: Artificial intelligence engineers create computer systems that can do the tasks humans would otherwise do. Information security analyst: This position requires you to ensure computer network security. Computer science teacher: If you love to teach others about computer science, you can earn a teaching certification and work in secondary education. IT project manager: A project manager leads a team of computer professionals in projects from conception to completion. Ryan Ercel O. Paderes ITCOM 1 Instructor Problem-solving technique Solving problems is the core of computer science. Programmers must first understand how a human solves a problem, then understand how to translate this "algorithm" into something a computer can do, and finally how to "write" the specific syntax (required by a computer) to get the job done. It is sometimes the case that a machine will solve a problem in a completely different way than a human. Problem solving consists of using generic or ad hoc methods in an orderly manner to find solutions to problems. Some of the problem-solving techniques developed and used in philosophy, artificial intelligence, computer science, engineering, mathematics, medicine and societies in general are related to mental problem-solving techniques studied in psychology and cognitive sciences. In computer science and in the part of artificial intelligence that deals with algorithms, problem solving includes techniques of algorithms, heuristics and root cause analysis. The amount of resources (e.g. time, memory, energy) required to solve problems is described by computational complexity theory. In more general terms, problem solving is part of a larger process that encompasses problem determination, de-duplication, analysis, diagnosis, repair, and other steps. Computer science, as it pertains to the problem-solving process itself, is also the study of abstraction. Abstraction allows us to view the problem and solution in such a way as to separate the so-called logical and physical perspectives. Steps involved in problem-solving 1. Analyzing the problem 2. Developing the algorithm 3. Coding 4. Testing and debugging Before we are ready to solve a problem, we must look over the question and understand it. By analyzing it, we can figure out the outputs and inputs to be carried out. If we are not ready with what we have to solve, then we end up with the question and cannot find the answer as expected. It is required to decide a solution before writing a program. The representation of solution in a natural language, called an algorithm. We must design, develop and decide the final approach after a number of trials and errors. Developing an algorithm captures and refines all the aspects of the desired solution. Once we finalize the algorithm, we must convert the decided algorithm into a code. The code can be written in dedicated programming languages. So, that is understandable by the computer to find a desired solution. In this stage, a wide variety of programming language are used to convert the algorithm into code. Designed and developed program undergoes several rigorous tests based on various real-time parameters. Industries and many companies follow some testing methods like system testing, component testing and acceptance testing. It must meet the user’s requirements, which have to respond with the required time and generate all expected outputs. Problem solving flow [ Right mindset] --> [ Making right decisions] --> [ Keeping ideas on track] --> [ Learning from feedbacks] --> [ Asking questions] The way to approach problems is the key to improving the skills. To find a solution, a positive mindset helps to solve problems quickly. When we need to solve a problem, we must be clear with a solution. The perfect solution helps to get success in a shorter period. Ideas always help much in improving the skills. They also help to gain more knowledge and more command over things. A crucial part of learning is from the feedback. Mistakes help you gain more knowledge and have much growth. Questions are an incredible part of life. While searching for solutions, there are a lot of questions that arise in our minds. Computer Programming is a step-by-step process of designing and developing various sets of computer programs to accomplish a specific computing outcome. The process comprises several tasks like analysis, coding, algorithm generation, checking accuracy and resource consumption of algorithms, etc. The purpose of computer programming is to find a sequence of instructions that solve a specific problem on a computer. Ryan Ercel O. Paderes ITCOM 1 Instructor English is the most popular and well-known Human Language. The English language has its own set of grammar rules, which has to be followed to write in the English language correctly. Likewise, any other Human Languages (German, Spanish, Russian, etc.) are made of several elements like nouns, adjective, adverbs, propositions, and conjunctions, etc. So, just like English, Spanish or other human languages, programming languages are also made of different elements. Just like human languages, programming languages also follow grammar called syntax. There are certain basic program code elements which are common for all the programming languages. Computer programming is a set of written instructions that the computer follows. These instructions can be written in various languages. Each programming languages have their unique ways of organizing the commands, which are called syntax. Multiple programming languages can help you solve the same programming problem. However, you need to select a language that you feel is relevant to perform your task. If you decide that a language does not suit your business requirement, you can always move on to a new language. Your skill in the chosen language will also be a deciding factor. Expected software system response time, a number of simultaneous users, security, maintains, compatibility with web, mobile, devices are few other factors to consider while choosing a language. Flowcharts A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be defined as a diagrammatic representation of an algorithm, a step-by-step approach to solving a task. The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrows. This diagrammatic representation illustrates a solution model to a given problem. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields. Flowchart is a very intuitive method to describe processes. As such, in most cases, you don’t need to worry too much about the standards and rules of all the flowchart symbols. In fact, a simple flowchart, constructed with just rectangular blocks and flowlines, can already get most jobs done. However, if you want to get technical and precise, there are preset rules and standards you can follow. Specifically, the American National Standards Institute (ANSI) set standards for flowcharts and their symbols in the 1960s. Afterwards, the International Organization for Standardization (ISO) adopted the ANSI symbols in 1970. In general, flowcharts flow from top to bottom and left to right. Flowchart symbol Name/Function Flowline Symbol: Shows the process’ direction. Each flowline connects two blocks. Terminal Symbol: Indicates the beginning or end of a flowchart. Process: Represent a step in a process. This is the most common component of a flowchart. Decision Symbol: Shows a step that decides the next step in a process. This is commonly a yes/no or true/false question. Input / Output Symbol: Indicates the process of inputting or outputting external data. This is indicated by the shape of a parallelogram. Annotation / Comment Symbol: Indicates additional information regarding a step in a process. Ryan Ercel O. Paderes ITCOM 1 Instructor Predefined Process Symbol: Shows named process which is defined elsewhere. On-page Connector Symbol: are pairs of on-page connecter are used to replace long lines on a flowchart page. Off-page Connector Symbol: An off-page connector is used when the target is on another page. Read our flowchart connector guide for more information on how on-page and off-page connectors work. Delay Symbol: Any delay period that is part of a process Alternate Process Symbol: An alternate to the normal process step. Flow lines to an alternate process block is usually dashed. Data Symbol: Data input or output Document Symbol: A document Multi-document Symbol: Multiple documents Preparation Symbol: A preparation step Display Symbol: A machine display Manual Input Symbol: Data or information into a system Manual Operation Symbol: A process step that isn’t automated Top 4 Flowchart Symbols in Use Ryan Ercel O. Paderes ITCOM 1 Instructor When Wikipedians discussed their collaboration process, they created a flowchart that was updated as the debate progressed. Having a picture of what was being proposed helped the discussion: Figure 1.1 Wiki edition process (adapted from http://wikipedia.org). Like the editing process above, computer code is essentially a process. Programmers often use flowcharts for writing down computing processes. When doing so, you should follow these guidelines for others to understand your flowcharts: Write states and instruction steps inside rectangles. Write decision steps, where the process may go different ways, inside diamonds. Never mix an instruction step with a decision step. Connect sequential steps with arrows. Mark the start and end of the process. Let’s see how this works for finding the biggest of three numbers: Finding the maximum value between three variables. PseudoCode A Pseudocode is defined as a step-by-step description of an algorithm. Pseudocode does not use any programming language in its representation instead it uses the simple English language text as it is intended for human understanding rather than machine reading. Pseudocode is the intermediate state between an idea and its implementation(code) in a high-level language. What is the need for Pseudocode Pseudocode is an important part of designing an algorithm, it helps the programmer in planning the solution to the problem as well as the reader in understanding the approach to the problem. Pseudocode is an intermediate state between algorithm and program that plays supports the transition of the algorithm into the program. Ryan Ercel O. Paderes ITCOM 1 Instructor Pseudocode is an intermediate state between algorithm and program How to write Pseudocode? Before writing the pseudocode of any algorithm the following points must be kept in mind. Benefits of Pseudocode Using pseudocode has several benefits, including: 1. Easy to Understand: Pseudocode uses plain language and simple syntax, making it easy for anyone to understand. 2. Saves Time: By creating a plan in pseudocode, developers can save time by catching errors and bugs before they write actual code. 3. Improves Communication: Pseudocode allows developers to communicate their ideas with other developers or stakeholders, even if they don’t know the same programming language. 4. Flexibility: Pseudocode is not bound by any specific programming language rules, which means that developers can use their own words and phrases to express their ideas. Steps to Write Pseudocode 1. Start by identifying the problem you need to solve and understanding the requirements. 2. Break the problem down into smaller, manageable parts. 3. Write out the steps needed to solve each part of the problem in plain language. 4. Test your pseudocode by walking through each step and identifying any potential issues. 5. Refine and revise your pseudocode as needed until you have a clear and effective plan. Example of Pseudocode Using Python Here’s an example of how to write pseudocode using Python to solve a problem: Problem: Create a program that calculates the area of a circle. Pseudocode: 1. Get the radius of the circle from the user. 2. Calculate the area of the circle using the formula: area = π * r² 3. Display the result to the user. Python Code: radius = float(input("Enter the radius of the circle: ")) pi = 3.14 area = pi * (radius ** 2) print("The area of the circle is", area) This code prompts the user to enter the radius of a circle, calculates the area of the circle using the formula pi * radius², and then prints the result to the console. Ryan Ercel O. Paderes ITCOM 1 Instructor