• Trending Now
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial

CBSE Class 11 | Problem Solving Methodologies

Problem solving process.

The process of problem-solving is an activity which has its ingredients as the specification of the program and the served dish is a correct program. This activity comprises of four steps : 1. Understanding the problem: To solve any problem it is very crucial to understand the problem first. What is the desired output of the code and how that output can be generated? The obvious and essential need to generate the output is an input. The input may be singular or it may be a set of inputs. A proper relationship between the input and output must be drawn in order to solve the problem efficiently. The input set should be complete and sufficient enough to draw the output. It means all the necessary inputs required to compute the output should be present at the time of computation. However, it should be kept in mind that the programmer should ensure that the minimum number of inputs should be there. Any irrelevant input only increases the size of and memory overhead of the program. Thus Identifying the minimum number of inputs required for output is a crucial element for understanding the problem.

2. Devising the plan: Once a problem has been understood, a proper action plan has to be devised to solve it. This is called devising the plan. This step usually involves computing the result from the given set of inputs. It uses the relationship drawn between inputs and outputs in the previous step. The complexity of this step depends upon the complexity of the problem at hand.

3. Executing the plan: Once the plan has been defined, it should follow the trajectory of action while ensuring the plan’s integrity at various checkpoints. If any inconsistency is found in between, the plan needs to be revised.

4. Evaluation: The final result so obtained must be evaluated and verified to see if the problem has been solved satisfactorily.

Problem Solving Methodology(The solution for the problem)

The methodology to solve a problem is defined as the most efficient solution to the problem. Although, there can be multiple ways to crack a nut, but a methodology is one where the nut is cracked in the shortest time and with minimum effort. Clearly, a sledgehammer can never be used to crack a nut. Under problem-solving methodology, we will see a step by step solution for a problem. These steps closely resemble the software life cycle . A software life cycle involves several stages in a program’s life cycle. These steps can be used by any tyro programmer to solve a problem in the most efficient way ever. The several steps of this cycle are as follows :

Step by step solution for a problem (Software Life Cycle) 1. Problem Definition/Specification: A computer program is basically a machine language solution to a real-life problem. Because programs are generally made to solve the pragmatic problems of the outside world. In order to solve the problem, it is very necessary to define the problem to get its proper understanding. For example, suppose we are asked to write a code for “ Compute the average of three numbers”. In this case, a proper definition of the problem will include questions like : “What exactly does average mean?” “How to calculate the average?”

Once, questions like these are raised, it helps to formulate the solution of the problem in a better way. Once a problem has been defined, the program’s specifications are then listed. Problem specifications describe what the program for the problem must do. It should definitely include :

what is the input set of the program

What is the desired output of the program and in what form the output is desired?

2. Problem Analysis (Breaking down the solution into simple steps): This step of solving the problem follows a modular approach to crack the nut. The problem is divided into subproblems so that designing a solution to these subproblems gets easier. The solutions to all these individual parts are then merged to get the final solution of the original problem. It is like divide and merge approach.

Modular Approach for Programming :

The process of breaking a large problem into subproblems and then treating these individual parts as different functions is called modular programming. Each function behaves independent of another and there is minimal inter-functional communication. There are two methods to implement modular programming :

  • Top Down Design : In this method, the original problem is divided into subparts. These subparts are further divided. The chain continues till we get the very fundamental subpart of the problem which can’t be further divided. Then we draw a solution for each of these fundamental parts.
  • Bottom Up Design : In this style of programming, an application is written by using the pre-existing primitives of programming language. These primitives are then amalgamated with more complicated features, till the application is written. This style is just the reverse of the top-down design style.

3. Problem Designing: The design of a problem can be represented in either of the two forms :

The ways to execute any program are of three categories:

  • Sequence Statements Here, all the instructions are executed in a sequence, that is, one after the another, till the program is executed.
  • Selection Statements As it is self-clear from the name, in these type of statements the whole set of instructions is not executed. A selection has to be made. A selected number of instructions are executed based on some condition. If the condition holds true then some part of the instruction set is executed, otherwise, another part of the set is executed. Since this selection out of the instruction set has to be made, thus these type of instructions are called Selection Statements.

Identification of arithmetic and logical operations required for the solution : While writing the algorithm for a problem, the arithmetic and logical operations required for the solution are also usually identified. They help to write the code in an easier manner because the proper ordering of the arithmetic and logical symbols is necessary to determine the correct output. And when all this has been done in the algorithm writing step, it just makes the coding task a smoother one.

  • Flow Chart : Flow charts are diagrammatic representation of the algorithm. It uses some symbols to illustrate the starting and ending of a program along with the flow of instructions involved in the program.

4. Coding: Once an algorithm is formed, it can’t be executed on the computer. Thus in this step, this algorithm has to be translated into the syntax of a particular programming language. This process is often termed as ‘coding’. Coding is one of the most important steps of the software life cycle. It is not only challenging to find a solution to a problem but to write optimized code for a solution is far more challenging.

Writing code for optimizing execution time and memory storage : A programmer writes code on his local computer. Now, suppose he writes a code which takes 5 hours to get executed. Now, this 5 hours of time is actually the idle time for the programmer. Not only it takes longer time, but it also uses the resources during that time. One of the most precious computing resources is memory. A large program is expected to utilize more memory. However, memory utilization is not a fault, but if a program is utilizing unnecessary time or memory, then it is a fault of coding. The optimized code can save both time and memory. For example, as has been discussed earlier, by using the minimum number of inputs to compute the output , one can save unnecessary memory utilization. All such techniques are very necessary to be deployed to write optimized code. The pragmatic world gives reverence not only to the solution of the problem but to the optimized solution. This art of writing the optimized code also called ‘competitive programming’.

5. Program Testing and Debugging: Program testing involves running each and every instruction of the code and check the validity of the output by a sample input. By testing a program one can also check if there’s an error in the program. If an error is detected, then program debugging is done. It is a process to locate the instruction which is causing an error in the program and then rectifying it. There are different types of error in a program : (i) Syntax Error Every programming language has its own set of rules and constructs which need to be followed to form a valid program in that particular language. If at any place in the entire code, this set of rule is violated, it results in a syntax error. Take an example in C Language

In the above program, the syntax error is in the first printf statement since the printf statement doesn’t end with a ‘;’. Now, until and unless this error is not rectified, the program will not get executed.

Once the error is rectified, one gets the desired output. Suppose the input is ‘good’ then the output is : Output:

(ii) Logical Error An error caused due to the implementation of a wrong logic in the program is called logical error. They are usually detected during the runtime. Take an example in C Language:

In the above code, the ‘for’ loop won’t get executed since n has been initialized with the value of 11 while ‘for’ loop can only print values smaller than or equal to 10. Such a code will result in incorrect output and thus errors like these are called logical errors. Once the error is rectified, one gets the desired output. Suppose n is initialised with the value ‘5’ then the output is : Output:

(iii) Runtime Error Any error which causes the unusual termination of the program is called runtime error. They are detected at the run time. Some common examples of runtime errors are : Example 1 :

If during the runtime, the user gives the input value for B as 0 then the program terminates abruptly resulting in a runtime error. The output thus appears is : Output:

Example 2 : If while executing a program, one attempts for opening an unexisting file, that is, a file which is not present in the hard disk, it also results in a runtime error.

6. Documentation : The program documentation involves :

  • Problem Definition
  • Problem Design
  • Documentation of test perform
  • History of program development

7. Program Maintenance: Once a program has been formed, to ensure its longevity, maintenance is a must. The maintenance of a program has its own costs associated with it, which may also exceed the development cost of the program in some cases. The maintenance of a program involves the following :

  • Detection and Elimination of undetected errors in the existing program.
  • Modification of current program to enhance its performance and adaptability.
  • Enhancement of user interface
  • Enriching the program with new capabilities.
  • Updation of the documentation.

Control Structure- Conditional control and looping (finite and infinite)

There are codes which usually involve looping statements. Looping statements are statements in which instruction or a set of instructions is executed multiple times until a particular condition is satisfied. The while loop, for loop, do while loop, etc. form the basis of such looping structure. These statements are also called control structure because they determine or control the flow of instructions in a program. These looping structures are of two kinds :

In the above program, the ‘for’ loop gets executed only until the value of i is less than or equal to 10. As soon as the value of i becomes greater than 10, the while loop is terminated. Output:

In the above code, one can easily see that the value of n is not getting incremented. In such a case, the value of n will always remain 1 and hence the while loop will never get executed. Such loop is called an infinite loop. Output:

Similar Reads

  • CBSE Class 11 | Problem Solving Methodologies Problem Solving Process The process of problem-solving is an activity which has its ingredients as the specification of the program and the served dish is a correct program. This activity comprises of four steps : 1. Understanding the problem: To solve any problem it is very crucial to understand th 13 min read
  • Critical Thinking Math Problems Ability to make decisions by the application of logical, sceptic, and objective analyses and evaluations of data, arguments, and other evidence is known as critical thinking. Regarding mathematics, critical thinking is not only about making calculations but also involves logical reasoning, pattern r 10 min read
  • Class 11 NCERT Solutions - Chapter 1 Sets - Exercise 1.6 Chapter 1 of Class 11 NCERT Mathematics focuses on "Sets" a fundamental concept in mathematics that provides the basis for the various mathematical structures and operations. Understanding sets is crucial for grasping more advanced topics in algebra, calculus, and discrete mathematics. Exercise 1.6 8 min read
  • NCERT Solutions for Class 9 English Moments Chapter 1 The Lost Child We have tried to provide NCERT Solutions for Supplementary English Class 9 Chapter 1 The Lost Child covering each & every question of Supplementary English. Students will improve their answer writing skills by referring to the following NCERT Solutions for Class 9 Supplementary English Moments. 6 min read
  • NCERT Solutions for Class 9 English Beehive Chapter 3 The Little Girl We have tried to provide NCERT Solutions for Class 9 English- Chapter 3 The Little Girl covering each and every question of the textbook Beehive. Students will improve their answer writing skills by referring to the following NCERT Solutions for Class 9 English Beehive. The following NCERT Solutions 13 min read
  • NCERT Solutions for Class 9 English Beehive Chapter 1 The Fun They Had We have tried to provide NCERT Solutions for Class 9 English Chapter 1 The Fun They Had covering each and every question of the textbook Beehive. Students will improve their answer writing skills by referring to the following NCERT Solutions for Class 9 English Beehive. The following NCERT Solutions 14 min read
  • CBSE 10th Board Exam Experience For every Indian student, the Central Board of Secondary Education (CBSE) 10th board exams mark a significant milestone in their academic journey. These exams are not just assessments of academic prowess; they are rites of passage, symbolizing the transition from secondary to higher secondary educat 4 min read
  • How to read Competitive Programming Questions? Competitive Programming is considered as a sport in the field of computer science. The culture of this sport is growing day by day and a lot of people are also considering this as a career choice. So, to help the participants with improving their efficiency in this sport, in this post, we have tried 5 min read
  • Non Verbal Reasoning : Paper Cutting Non-verbal reasoning is integral to the Staff Selection Commission (SSC) Combined Graduate Level (CGL) examination, which no student should avoid. You can take a good lead in this section with practice. One common and very important topic of Non-Verbal reasoning is paper cutting, which involves anal 6 min read
  • Non-Verbal Reasoning : Dot Situation SSC CGL examination has one of the most important sections i.e. Non-Verbal Reasoning section. It includes many important topics and out of which Dot Situation-related questions are frequently asked. Sometimes, Dot situation-based questions can be tricky and confusing, but with continuous practice an 4 min read
  • Accolite Interview Experience | Set 4 (On-Campus) Round 1 (Written) Around 140 students appeared for the offline test. There were 20 MCQs that to be done in (30 minutes), questions were from OS,DBMS,Datastructures. After that coding round was there (paper coding) in which 3 questions were given and we have to attempt any 2 (1 hour) 1. Write your ow 8 min read
  • Points to focus on while doing Competitive Programming Competitive Programming is vital for one’s development in the coding field. This article is going to discuss some basics points one should keep in mind while competing. Make a list of functions to perform tasks that are encountered frequently in questions and add them to your code in the form of a t 5 min read
  • OLA Interview Experience | Set 11 ( For Internship) Round 1 (Online Test): Four Programming Questions- a) Given a string find number of different substrings that are palindromes. b) In a matrix we can destruct it's one column by vanishing any of the element in column . We have to destruct the matrix completely so that sum of the elements destucted by 2 min read
  • Final Exam | Google Kickstart 2021 Round D It's time for the final exam in algorithms and data structures! Edsger prepared N sets of problems. Each set consists of problems in an increasing difficulty sequence; the i-th set can be described by two integers Ai and Bi (Ai≤Bi), which denotes that this set contains problems with difficulties Ai, 12 min read
  • Cisco Interview Experience | Set 9 (For Experienced) Written Test: 1) 15 Aptitude Questions 2) 25 CS Fundamentals & Couple of output questions. 3) Coding Question: A thief trying to escape from a jail has to cross 'N' walls each with varying heights. He climbs 'X' feet every time. But, due to the slippery nature of those walls, every times he slip 2 min read
  • Amazon Interview | Set 55 (On-Campus) Online Test on InterviewStreet: 18 MCQs (Normal C loop questions, networking, dbms, os, analytical) 2 Coding questions 1. Check if an undirected graph is a tree or not. 2. Given an array of integers, print the 2 elements with least absolute difference. Interview Rounds:- Round 1: Tell me about yours 4 min read
  • MakeMyTrip Interview Experience | Set 6 (Online Coding) Round-1: Online test There were 2 sections – Aptitude and Coding Section A- 20 MCQ's on General Aptitude. Section B- There were 3 coding questions. 1) Given an array and 2 numbers l,r find the number of elements in the array in between l and r; 2) Calculate a power b (b -> [1,1000000000] (required a 3 min read
  • Microsoft Interview experience | Set 98 (On Campus for IDC) Round 1 : (1hr 15 min) Online test on CoCubes contains 3 Coding Questions Calculate difficulty of a given sentence. Where difficulty of a word is: Word is hard if it has 4 consecutive consonants or number of consonants are more than number of vowels else word is easy. Difficulty of sentence is defin 3 min read
  • MakeMyTrip Interview Experience | Set 8 (On-Campus) MakeMyTrip recently visited our campus. There were 4 rounds. Online Round ( 1 Hour ) This round consisted of 20 aptitude questions and 3 coding Questions. Coding Questions: 1. Find ‘x’ in the equation. The input is in the form of a string. Equation consisted of addition operator only and 2 integers 3 min read
  • School Programming

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Problem Solving

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.

Computer Programmers are problem solvers. In order to solve a problem on a computer you must:

Know how to represent the information (data) describing the problem.

Determine the steps to transform the information from one representation into another.

Information Representation

A computer, at heart, is really dumb. It can only really know about a few things... numbers, characters, booleans, and lists (called arrays) of these items. (See Data Types). Everything else must be "approximated" by combinations of these data types.

A good programmer will "encode" all the "facts" necessary to represent a problem in variables (See Variables). Further, there are "good ways" and "bad ways" to encode information. Good ways allow the computer to easily "compute" new information.

An algorithm (see Algorithm) is a set of specific steps to solve a problem. Think of it this way: if you were to tell your 3 year old neice to play your favorite song on the piano (assuming the neice has never played a piano), you would have to tell her where the piano was, and how to sit on the bench, and how to open the cover, and which keys to press, and which order to press them in, etc, etc, etc.

The core of what good programmers do is being able to define the steps necessary to accomplish a goal. Unfortunately, a computer, only knows a very restricted and limited set of possible steps. For example a computer can add two numbers. But if you want to find the average of two numbers, this is beyond the basic capabilities of a computer. To find the average, you must:

  • First: Add the two numbers and save this result in a variable
  • Then: Divide this new number the number two, and save this result in a variable.
  • Finally: provide this number to the rest of the program (or print it for the user).

We "compute" all the time. Computing is the act of solving problems (or coming up with a plan to solve problems) in an organized manner. We don't need computers to "compute". We can use our own brain.

Encapsulation and Abstraction and Complexity Hiding

Computer scientists like to use the fancy word "Encapsulation" to show how smart we are. This is just a term for things we do as humans every day. It is combined with another fancy term: "Abstraction".

Abstraction is the idea of "ignoring the details". For example, a forest is really a vastly complex ecosystem containing trees, animals, water paths, etc, etc, etc. But to a computer scientist (and to a normal person), its just "a forest".

For example, if your professor needs a cup of coffee, and asks you the single item: "Get me a cup of coffee", he has used both encapsulation and abstraction. The number of steps required to actually get the coffee are enumerable. Including, getting up, walking down the hall, getting in your car, driving to a coffee stand, paying for the coffee, etc, etc, etc. Further, the idea of what a cup of coffee is, is abstract. Do you bring a mug of coffee, or a Styrofoam cup? Is it caffeinated or not? Is it freshly brewed or from concentrate? Does it come from Africa or America?

All of this information is TOO MUCH and we would quickly be unable to funciton if we had to remember all of these details. Thus we "abstract away" the details and only remember the few important items.

This brings us to the idea of "Complexity Hiding". Complexity hiding is the idea that most of the times details don't matter. In a computer program, as simple an idea as drawing a square on the screen involves hundreds (if not thousands) of (low level) computer instructions. Again, a person couldn't possible create interesting programs if every time they wanted to do something, they had to re-write (correctly) every one of those instructions. By "ecapsulating" what is meant by "draw square" and "reusing" this operation over and over again, we make programming tractable.

Encapsulation

The idea behind encapsulation is to store the information necessary to a particular idea in a set of variables associated with a single "object". We then create functions to manipulate this object, regardless of what the actual data is. From that point on, we treat the idea from a "high level" rather than worry about all the parts (data) and actions (functions) necessary to represent the object in a computer.

Brute Force

Brute force is a technique for solving problems that relies on a computers speed (how fast it can repeat steps) to solve a problem. For example, if you wanted to know how many times the number 8 goes into the number 100, you could do the following:

Of course this is a silly way for a computer (or a human) to solve this problem. The real way we would do it is:

When in doubt, you can often use "brute force" to solve a problem, but it often saves time (at least computer time) to think about the problem and solve it in an elegant manner.

  • Python Programming
  • C Programming
  • Numerical Methods
  • Dart Language
  • Computer Basics
  • Deep Learning
  • C Programming Examples
  • Python Programming Examples

Problem Solving Using Computer (Steps)

Computer based problem solving is a systematic process of designing, implementing and using programming tools during the problem solving stage. This method enables the computer system to be more intuitive with human logic than machine logic. Final outcome of this process is software tools which is dedicated to solve the problem under consideration. Software is just a collection of computer programs and programs are a set of instructions which guides computer’s hardware. These instructions need to be well specified for solving the problem. After its creation, the software should be error free and well documented. Software development is the process of creating such software, which satisfies end user’s requirements and needs.

The following six steps must be followed to solve a problem using computer.

  • Problem Analysis
  • Program Design - Algorithm, Flowchart and Pseudocode
  • Compilation and Execution
  • Debugging and Testing
  • Program Documentation
  • Class 6 Maths
  • Class 6 Science
  • Class 6 Social Science
  • Class 6 English
  • Class 7 Maths
  • Class 7 Science
  • Class 7 Social Science
  • Class 7 English
  • Class 8 Maths
  • Class 8 Science
  • Class 8 Social Science
  • Class 8 English
  • Class 9 Maths
  • Class 9 Science
  • Class 9 Social Science
  • Class 9 English
  • Class 10 Maths
  • Class 10 Science
  • Class 10 Social Science
  • Class 10 English
  • Class 11 Maths
  • Class 11 Computer Science (Python)
  • Class 11 English
  • Class 12 Maths
  • Class 12 English
  • Class 12 Economics
  • Class 12 Accountancy
  • Class 12 Physics
  • Class 12 Chemistry
  • Class 12 Biology
  • Class 12 Computer Science (Python)
  • Class 12 Physical Education
  • GST and Accounting Course
  • Excel Course
  • Tally Course
  • Finance and CMA Data Course
  • Payroll Course

Interesting

  • Learn English
  • Learn Excel
  • Learn Tally
  • Learn GST (Goods and Services Tax)
  • Learn Accounting and Finance
  • GST Tax Invoice Format
  • Accounts Tax Practical
  • Tally Ledger List
  • GSTR 2A - JSON to Excel
  • MCQ questions (1 mark each)
  • True or False Questions (1 mark each)
  • Fill in the Blanks Questions (1 Mark each)
  • Very Short Answer Type Questions (1 Mark each)
  • Short Answer Type Questions (2 Marks each)
  • Long Answer Type Questions (3 Marks each)

Steps for Problem Solving

Last updated at April 16, 2024 by Teachoo

Steps for Problem Solving - Teachoo.jpg

  • Analyzing the Problem: Involves identifying the problem , inputs the program should accept and the desired output of the program.
  • Developing an Algorithm: The solution to the problem represented in natural language is called Algorithm. For a given problem, more than one algorithm is possible and we have to select the most suitable solution.
  • Coding: Different high level languages can be used for writing the code based on the algorithm developed.
  • Testing and Debugging: To ensure that the software meets all the business and technical requirements and works as expected . The errors or defects found in the testing phases are debugged or rectified and the program is again tested . This continues till all the errors are removed from the program.  

Davneet Singh's photo - Co-founder, Teachoo

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo

Hi, it looks like you're using AdBlock :(

Please login to view more pages. it's free :), solve all your doubts with teachoo black.

Oberlin College Computer Science

  • Course Websites
  • CS Lab Helper Schedule

Problem Solving Tips

  • Course Catalog
  • Major/Minor in CS
  • Electives Schedule
  • Intro Course Placement
  • Academic Calendar
  • Department Honors
  • Bob Geitz (chair)
  • Stephen Checkoway
  • Roberto Hoyle
  • Dylan McKay
  • Sam Taggart
  • Cynthia Taylor
  • Blair Rossetti
  • Molly Feldman
  • 2013-Wearable-Electronics
  • 2011 ACM Programming Contest
  • 2013 Alexa's Tenure Celebration
  • 2013 Pledge Ceremony
  • 2012 Games Showcase
  • 2011 CSMC Unix Night
  • MCURCSM 2009
  • 2009 Games Showcase
  • OCCS 25th Anniversary
  • 2010 Spring Social
  • 2009 Spring Picnic
  • 2009 Math/CS Ice Cream Social
  • 2008 Spring Picnic
  • 2010 Denison Programming Contest
  • 2008 Math/CS Sundae Friday
  • 2009 ACM Programming Contest
  • 2009 Denison Programming Contest
  • 2008 ACM Programming Contest
  • 2008 Denison Programming Contest
  • 2007 ACM Programming Contest
  • 2006 ACM Programming Contest
  • Oberlin College

One of the most important skills you learn in your computer science courses is how to problem solve. Although we cover some general problem solving paradigms in class, the best way to improve these skills is to get practice, practice, and more practice. Different people have different techniques that work best for them; below are some general tips that work for most people.

Please read these suggestions carefully.

Questions the Helpers May Ask You

When you ask a lab helper for their assistance, they will assume you have tried to solve the problem yourself. They will (reasonably) expect that you have tried out the steps outlined in this document; you should therefore be prepared to answer the following questions:

  • Did you re-read the prelab and lab?
  • Do you understand the problem?
  • Have you tried solving some examples by hand?
  • (For problems designing a solution) What have you tried? What topic from class does this most ressemble?
  • If you can’t solve the problem whole-hog, what small case can you solve?
  • (For syntax errors) What line of your code is causing the error? What do you think the compile error means, and what usually causes this kind of problem?
  • (For logical errors) On what example does your program consistently break? Have you traced through the program? Which line of your program is not doing what it should?

Four Main Problem Solving Steps:

1. understand the problem..

Solving the right problem is the most important part of problem solving. Be sure, absolutely 100% positively sure, that you understand the problem before attempting a solution. This involves:

  • Reading the prelab and lab very carefully (including all bold text, italicized text, and everything else);
  • Reviewing class notes on related topics;
  • Trying some small examples to make sure you understand what is being asked; if examples are given to you, make sure you understand them before continuing, as they are usually there to help clarify some common misconceptions; and
  • Asking someone to help clarify anything that is still confusing.

2. Design a Solution.

Formulate an algorithm to solve your problem. This involves:

  • Understanding what is being asked of you. See step 1.
  • Draw out some examples. Use paper . How would you solve these small cases, by hand? Is there a method to what you are doing? Try to formalize the steps you are taking, and try to think about whether they would work more generally, in bigger cases. Then try some bigger cases and convince yourself.
  • Reread the prelab . Did you already run some examples by hand? Did you have trouble with it then?
  • Write down the stuff you know about the problem and the examples you’ve tried, so that you can more easily find patterns .
  • Might a recent topic from class help? Usually at least some, if not most, of the lab will make use of recently covered material . Go over that topic, make sure you understand it, then try to make connections to lab.
  • Split the problem into smaller (more manageable) chunks, and try to solve the simpler problems. Go as small as you need in order to find some solution. Once you have the smaller problem solved, worry about how to generalize it to a slightly larger problem.
  • Just try something , anything, even if it is completely random and obviously wrong. When/if your attempt doesn’t work, it may still give you insight into what may work. It is not as crazy as it initially sounds!
  • Use a friend, lab helper, puppet, etc. as a sounding board ; sometimes, just voicing your problem will lead you to the “aha!” moment you need.
  • If you are still stuck, step away from the keyboard . Take a walk, go eat dinner or have a coffee. Sleep on it. Not literally. Taking a break is sometimes the most productive thing you can do, trust me.
  • Finally, stay positive . Even when things don’t work, you can still gain a better understanding of the problem. Don’t give up, just go with the flow and see where it takes you. Struggling is part of the process!

3. Implement your Solution.

Write the code to solve your problem. This involves

  • Understanding the problem, and designing a solution on paper. See steps 1 and 2.
  • Translating your design into actual code. Rather than doing this linearly, implement small chunks at a time. Break your code into subroutines, and make sure that each subroutine works before proceeding to the next. Compile and save often .
  • If you run into syntax errors, determine which line of your code is causing the problem. You can do this by systematically commenting out blocks of code until you find the block that causes the problem.
  • If you run into logical errors (as in, the program compiles but does not do what it is supposed to), find some examples on which your problem consistently fails. Trace through the program line by line, with one of these examples, to figure out exactly which line is not doing what you intend it to.
  • If the output doesn’t match what you expect, use print statements to trace through what your program is doing, and compare that to what your program should be doing. Even better, if you know how to use a debugger (in eclipse, for example, use it!)

4. Check your Solution.

This step is often overlooked, but is absolutely crucial. Your program does not necessarily work because it works on the given test cases on the lab. You have to think critically about what you code. This involves

  • Certainly check your program on all test cases given to you on the lab and prelab. The prelab often specifically contains hand-solved test cases precisely for this purpose!
  • Thinking about the “ boundary cases ,” such as, when would this array go out of bounds? For what indices will this for loop start and end?
  • Think: how would this program break ? Then, that failing: how would I convince my skeptical friend it can’t be broken?

Remember: problem solving is a creative process, which cannot be forced. Don’t get angry if you don’t see the answer right away, or you don’t see it as fast as your friend. You will have different strengths, and you can always improve. You will learn from your mistakes, so that’s always a plus!

Last updated July 3rd, 2012 by asharp

Recent Posts

  • Congratulations Professor Stephen Checkoway; recipient of this prestigious award!
  • Class of 2021 Celebration
  • Undergraduate Research Symposium
  • Grad School Information meeting
  • Tech Resume Workshop Thursday April 1 4:45pm
  • Information
  • Jobs/Internships
  • Uncategorized
  • Association for Computing Machinery (ACM)
  • National Center for Women & Information Technology (NCWIT)
  • Computer Research Association (CRA)

OCCS Social Media

  • Entries feed
  • Comments feed
  • WordPress.org

Oberlin College Computer Science Department -- 10 N. Professor St., Oberlin, OH 44074 -- Phone: (440) 775-8043

Copyright © 1985-2024 Oberlin College Computer Science. Design by Benjamin A. Kuperman . Powered by WordPress .

IMAGES

  1. Steps for Problem Solving

    problem solving steps in computer science

  2. Computer Science 2210 Problem Solving and Design(1)

    problem solving steps in computer science

  3. 9 Step Problem Solving Model

    problem solving steps in computer science

  4. Contar Posteridade Constrict problem solving process Deliberadamente

    problem solving steps in computer science

  5. Information Problem-Solving Instruction

    problem solving steps in computer science

  6. 7 steps in problem solving

    problem solving steps in computer science

VIDEO

  1. Problem solving steps of Quality Circle (in Hindi)

  2. Problem Solving

  3. How Programmers Think

  4. 3.1. Problem solving

  5. Problem solving steps

  6. Problem Solving Steps

COMMENTS

  1. PDF Unit 2: Problem Solving

    1-2 Introduce data collection and problem solving. 3 Introduce the four steps of the problem solving process. 4-6 Apply the problem solving process. Use different strategies to plan and carry out the plan to solve several problems. 7-9 Reinforce the four steps of the problems solving process. 10-12 Count in the binary number system.

  2. PDF An Introduction to Computer Science and Problem Solving

    So, computer science is all about taking in information and then performing some computations & analysis to solve a particular problem or produce a desired result, which depends on the application at hand. Computer science is similar to mathematics in that both are used as a means of defining and solving some problem. In fact, computer-based ...

  3. CBSE Class 11

    Under problem-solving methodology, we will see a step by step solution for a problem. These steps closely resemble the software life cycle. A software life cycle involves several stages in a program's life cycle. These steps can be used by any tyro programmer to solve a problem in the most efficient way ever. The several steps of this cycle ...

  4. PDF Introduction to Problem Solving

    computer science student should know. It is pertinent to mention that computers themselves cannot solve a problem. Precise step-by-step instructions should be given by us to solve the problem. Thus, the success of a computer in solving a problem depends on how correctly and precisely we define the problem, design a solution

  5. Problem Solving

    Problem Solving . 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.

  6. PDF Computer Programming Problem Solving Process

    Step 1 - Identify the problem that must be solved. The first step is to identify the problem that needs to be solved. In this example, the largest number in the list must be found and displayed. Step 2 - Understand what the problem presents. The problem presents a list of numbers. A quick glance at the list shows all the numbers to be positive.

  7. Problem Solving Using Computer (Steps)

    Problem Solving Using Computer (Steps) Computer based problem solving is a systematic process of designing, implementing and using programming tools during the problem solving stage. This method enables the computer system to be more intuitive with human logic than machine logic. Final outcome of this process is software tools which is ...

  8. Steps for Problem Solving

    Analyzing the Problem: Involves identifying the problem , inputs the program should accept and the desired output of the program. Developing an Algorithm: The solution to the problem represented in natural language is called Algorithm. For a given problem, more than one algorithm is possible and we have to select the most suitable solution.

  9. PDF First Four Steps: Problem Definition

    CS@VT Intro Problem Solving in Computer Science ©2012 McQuain 1. Collect and analyzeinformation and data. - List every releventthing you can think of. - Fill in missing gaps. 2. Talk with people familiar with the problem. - Look past the obvious. - Get clarifications when you don't understand. 3. If at all possible, view the problem ...

  10. Oberlin College Computer Science » Problem Solving Tips

    Four Main Problem Solving Steps: 1. Understand the Problem. Solving the right problem is the most important part of problem solving. Be sure, absolutely 100% positively sure, that you understand the problem before attempting a solution. This involves: Reading the prelab and labvery carefully (including all bold text, italicized text, and ...