Topic 1_1 Problem Solving (1).pdf

Full Transcript

Topic 1.1 Problem Solving FCT0035 Problem Solving & Programming Sept 2024 To define what is problem- solving To describe the importance of problem-solving Lesson Objectives To describe some common terms in programming such as code,...

Topic 1.1 Problem Solving FCT0035 Problem Solving & Programming Sept 2024 To define what is problem- solving To describe the importance of problem-solving Lesson Objectives To describe some common terms in programming such as code, program, programming etc. To describe and apply the steps in problem-solving Introduction to Problem Solving DEFINITION OF IMPORTANCE IN OVERVIEW OF KEY PROBLEM SOLVING PROGRAMMING TOPICS Definition of Problem Solving Describe each of It’s a the following Problem solving terms in the fundamental skill is the process of in programming, context of programming: identifying an where the A program issue, ability to A code analyzing it, effectively programming Finding tackle effective challenges is solutions. essential to writing successful code. In programming, problem create algorithms that can solving is automate tasks, crucial solve real-world problems, because it optimize processes, allows debug codes. The developers to Importance Programming is not just understanding problems, and of Problem about writing devising the most efficient and effective solutions. code; it's Solving in about Programming Tell us what Algorithms do you Efficient solutions understand Effective solutions about: Step 1 Identify the Problem Step 2 Analyze the Problem The Step 3 Generate Possible Solutions Problem- Solving Step 4 Select the Best Solution Process Step 5 Implement the Solution Step 6 Evaluate the Results Step 1: Identify the Problem The first step in any problem- solving process is to clearly The Problem- identify and define the problem. This involves Solving understanding the problem’s nature, scope Process What is the problem? Example: Calculate the average of three integers Step 2: Analyze the Problem Inputs: what values are required by the process Outputs: what values to be calculated, produced or displayed by the process Formula: What formula to be used to get the output by using the inputs The Problem- Example: Solving Inputs: three integers (number1, number2, number3) Process Outputs: the average of the three integers Formula: the average = the sum of the three integers divided by three average = (number1 + number2 + number3 ) / 3 Step 3: Generate Possible Solutions Solution 1: Calculate the sum of the three integers, then divide the obtained sum by 3 to get the average sum = number1 + number2 + number3 average = sum / 3 The Problem- Solution 2: Calculate the average by using Solving the formula (number1 + number2 + number3) / 3 Process average = (number1 + number2 + number3) / 3 Solution 3: Calculate number1 / 3 , number2 / 3, and number3 / 3, then add them up Average = (number1 / 3) + (number2 / 3) + (number3/ 3) Step 4: Select the Best Solution The Problem- Select the one that you think is the easiest to understand Solving and to implement Example: You may select Process Solution 1 or Solution 2 and not Solution 3 Step 5: Implement the Solution The Problem- Solving Process Step 6: Evaluate the Results The Problem- Solving Process Key Takeaways Problem-solving is crucial in programming Problem solving involve some steps such as identifying, analyzing the problem. There might be a multitude solutions for a given problem and we can always select the ‘best’ one.

Use Quizgecko on...
Browser
Browser