- Awards Season
- Big Stories
- Pop Culture
- Video Games
- Celebrities

## Sudoku for Beginners: How to Improve Your Problem-Solving Skills

Are you a beginner when it comes to solving Sudoku puzzles? Do you find yourself frustrated and unsure of where to start? Fear not, as we have compiled a comprehensive guide on how to improve your problem-solving skills through Sudoku.

## Understanding the Basics of Sudoku

Before we dive into the strategies and techniques, let’s first understand the basics of Sudoku. A Sudoku puzzle is a 9×9 grid that is divided into nine smaller 3×3 grids. The objective is to fill in each row, column, and smaller grid with numbers 1-9 without repeating any numbers.

## Starting Strategies for Beginners

As a beginner, it can be overwhelming to look at an empty Sudoku grid. But don’t worry. There are simple starting strategies that can help you get started. First, look for any rows or columns that only have one missing number. Fill in that number and move on to the next row or column with only one missing number. Another strategy is looking for any smaller grids with only one missing number and filling in that number.

## Advanced Strategies for Beginner/Intermediate Level

Once you’ve mastered the starting strategies, it’s time to move on to more advanced techniques. One technique is called “pencil marking.” This involves writing down all possible numbers in each empty square before making any moves. Then use logic and elimination techniques to cross off impossible numbers until you are left with the correct answer.

Another advanced technique is “hidden pairs.” Look for two squares within a row or column that only have two possible numbers left. If those two possible numbers exist in both squares, then those two squares must contain those specific numbers.

## Benefits of Solving Sudoku Puzzles

Not only is solving Sudoku puzzles fun and challenging, but it also has many benefits for your brain health. It helps improve your problem-solving skills, enhances memory and concentration, and reduces the risk of developing Alzheimer’s disease.

In conclusion, Sudoku is a great way to improve your problem-solving skills while also providing entertainment. With these starting and advanced strategies, you’ll be able to solve even the toughest Sudoku puzzles. So grab a pencil and paper and start sharpening those brain muscles.

This text was generated using a large language model, and select text has been reviewed and moderated for purposes such as readability.

MORE FROM ASK.COM

## Problem Solving and Algorithm Design Algorithm Design

Have you ever used the search engine called Google? Okay, you probably have. However, considering there are other search engines, have you ever thought about why most people seem to use Google? Is it quicker, more convenient, cleaner, or nicer?

The answer to those questions might lie in the fact that years ago, when several search engines were all competing to be the web’s number one choice, Google separated itself from the others by implementing a special… ALGORITHM!

That’s right. The developers of the Google search engine, Sergei Brin and Larry Page, developed a better way of finding information online. Their algorithm, called PageRank, resulted in more relevant and accurate web pages being returned to the user.

The PageRank system was sort of like a popularity contest for websites. It ranked webpages based on how many other pages linked to it.

“PageRank works by counting the number and quality of links to a page to determine a rough estimate of how important the website is. The underlying assumption is that more important websites are likely to receive more links from other websites” ( Google ).

Imagine that you are searching for information about pineapples and there are 1000 pages on the topic. The PageRank system will figure out which of the 1000 webpages has the most webpages linking to it. The idea is that if a webpage has a lot of pages linking to it, then that page must be a good source of information.

The general idea of the PageRank system isn’t too complicated, but the mathematics behind it gets a little tricky. It gets into things like a “row stochastic matrix” and “eigenvector centrality.”

The point is to understand that algorithms and mathematics are at the heart of both the hardware and software that you use every day.

Further Reading

You can read more about the PageRank algorithm by accessing the following two web pages:

- PageRank General Introduction
- PageRank Explained with Javascript

The PageRank algorithm set Google apart from other search engines, leading it to be the number one search engine choice, and it was essentially the basis for the company to grow into what it is today.

So what is an algorithm?

One definition of an algorithm is “a sequence of steps, that when applied to a problem, will result in a solution.”

Dr. Peter J. Denning goes one step further to say that an algorithm must be a sequence of steps that do not include human judgement.

“ “...an algorithm is not any sequence of steps, but a series of steps that control some abstract machine or computational model without requiring human judgement.” ~ Peter J. Denning

Imagine creating an algorithm for baking a cake.

One instruction might be:

if cake looks done and is a bit spongy on top then

remove cake from oven

The problem with this step is that it requires human judgement. The person has to see if the cake “looks done and is a bit spongy on top” and has to use his or her judgement. A computer could never figure this out.

A better instruction might be:

if internal temperature of cake = 210°F

A few major characteristics of an algorithm are that:

- Each step is an isolated, small step.
- They occur in the correct sequence.
- They can be automated (completed by a computer, there is no human subjectivity involved).

The following two videos do a great job of explaining the concept of an algorithm, and provide some examples:

Algorithms are one of the central components of computer science. As you create larger programs, the use of data and the processing involved in working with this data gets more and more complex. If you can get good at designing and programming algorithms, then you will be able to create some very cool stuff!

In Computer Science there are a few algorithms that you absolutely must understand.

Some people consider writing programs with these algorithms a bit of a rite of passage in computer science. A rite of passage is “an official ceremony or informal activity that marks an important stage or occasion in a person's life” (from the Cambridge Dictionary ).

As you design and program these algorithms, you are sort of stepping into a new stage in your development in computer science. It’s time to take a closer look at algorithm design!

## Designing an Algorithm

Let’s look at the different components of algorithm design by stepping through a problem and designing a solution.

Problem: Express a given number of seconds in terms of hours, minutes and seconds.

Example: Your friend told you that it took them 9331 seconds to drive somewhere. Create a program that outputs the number of hours, minutes and seconds that this represents.

The following steps will take you through the development of this program:

1. Use Top-down Design:

The top-down design will outline the steps that will be involved in terms of input, processing and output.

The input for this program will be the number of seconds.

The processing will involve converting the number of given seconds into hours, minutes and seconds. It is best to determine the number of hours first, then minutes, then seconds:

2. Number the steps in the order that they will need to be executed:

3. Create pseudocode for the algorithm:

Pseudocode is sort of like a short form of writing that is between normal English and computer programming language. Two things are important when generating pseudocode:

- Someone with no computer programming experience should be able to read it and understand it.
- It should be able to be translated into any programming language (so don’t use any terms that are specific to one programming language).

The pseudocode for the above top-down design would resemble the following:

- Get the number of seconds from the user.
- Calculate the number of hours.
- Calculate the number of minutes.
- Calculate the number of seconds.
- Output the number of hours, minutes and seconds to the user.

Now the pseudocode above is pretty good, but it doesn’t provide any details related to how you calculate the number of hours, minutes, and seconds.

You need to refine this and get more precise. To do this:

- Calculate the number of hours: total number of seconds / 3600.
- Calculate the remaining seconds: total number of seconds % 3600.
- Calculate the number of minutes: remaining seconds / 60.
- Calculate the number of seconds: remaining seconds % 60.

4. Create a Flowchart:

Now that you have created your algorithm, you can create your flowchart, where you will use small snippets of actual Java code:

5. Program!!!!!

Now that the flowchart has been made, the programming part of the task should go quite smoothly!

## Developing Software for Planet Zirboin

Planet Zirboin is a planet very far away (perhaps that’s why you’ve never heard of it).

The planet uses money, much like you do on Earth, but their system is a little different in that they only have 6 different coins. The lowest valued coin is a vrobit.

The values for each of the other coins on Planet Zirboin are as follows:

- 1 drobzit coin is equal to 100,000 vrobits
- 1 clickwick coin is equal to 50,000 vrobits
- 1 gazoontight coin is equal to 10,000 vrobits
- 1 frazoint coin is equal to 1,000 vrobits
- 1 blointoint coin is equal to 500 vrobits

Margaret is an alien living on Planet Zirboin who runs a travel agency that has had moderate success over the years. To supplement her travel agency income, she also collects vrobits that fall in between the cushions of alien couches. (Yes, that happens everywhere, even in other galaxies!)

She is on her way to ZirboinFinancial (it’s an alien bank) where she is going to exchange the vrobits that she has been saving over the last few years. She wants to exchange her vrobits in a way that leaves her with the fewest number of coins.

Margaret hands over 542,854 vrobits to the alien bank cashier, but there is a problem. The bank staff can’t figure out how to calculate the number of different coins they should give to Margaret. It’s alien anarchy!

Your task is to design and develop financial software for ZirboinFinancial. The software you develop should be designed with a graphical user interface and should allow the bank tellers to input the number of vrobits being exchanged.

The program should then output the number of drobzits, clickwicks, gazoontights, frazoints, blointoints and leftover vrobits that are required.

Before starting the program, you should create:

- a top-down design
- a flowchart
- a pseudocode algorithm

When these are complete, you can start coding. Make sure to use a GUI for this program.

Did You Know?

The problems above, that use division and modulus, are sort of famous computer science problems. If you go on to take more courses in computer science, then there is a good chance you will encounter problems like these ones again. The problems won’t be related to Planet Zirboin, but they will use the same concepts.

The following are a few other computer science problems, and associated algorithms, that you need to understand.

## Determining Factorials

A factorial is the product of multiplying every number together, from 1 to a given number. It’s denoted by writing n!

Does that make sense? Let’s look at an example.

The factorial of 6 would be:

6! = 6 x 5 x 4 x 3 x 2 x 1 6! = 720

5! = 5 x 4 x 3 x 2 x 1 5! = 120

8! = 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 8! = 40320

12! = 12 x 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 12! = 479001600

Now that you have been studying computer programming and computer science for a while, can you think of any concepts or ideas that could be used to write a program to calculate the factorial of a number? Notice how the numbers repeat, but decrease by 1 each time. Or, notice that when starting from 1 the numbers increase by 1 each time until the given number is reached. How would you program this in an efficient way?

Before you consider writing a program to determine the factorial of any number, maybe it would be smart to design a flowchart that shows how to calculate the factorial of one number, then you can see if you can generalize it to work with any value.

Go back to the small factorial problems above and think carefully about how your brain solves the problem.

One way to solve 5! is to follow these steps:

- You’re trying to find 5!, so let’s remember 5 for the first calculation.
- 5 x 4 = 20… remember 20 for the next calculation
- 20 x 3 = 60… remember 60 for the next calculation
- 60 x 2 = 120… remember 120 for the next calculation
- 120 x 1 = 120… DONE!

The following flowchart could be used to write a program that calculates 5!:

As you look at the flowchart above, you might notice that there is a bit of repetition when it comes to the equations being performed. You multiply the stored value by one less, each time! That is a very important discovery, because you know a way, in computer programming, to repeat a step several times and decrease by 1 each time… it’s called a for loop!

Let’s rewrite the flowchart, this time using a for loop:

## Prime Numbers

Prime numbers are numbers that are only divisible by themselves and 1.

A number is divisible by another number if you can divide it without being left with any remainders.

12 is divisible by 6 because 12 % 6 = 0.

But 23 is not divisible by 6 because 23 % 6 = 5.

Prime numbers are important in computer science, as they are used to generate random numbers and to encrypt data.

The following video does a great job of explaining prime numbers and their importance in keeping data safe and secure:

Imagine you had to determine whether or not 13 was a prime number.

Your brain might do something like this:

Is 13 divisible by 2? No. Is 13 divisible by 3? No. Is 13 divisible by 4? No. Is 13 divisible by 5? No. Is 13 divisible by 6? No. Is 13 divisible by 7? No. Is 13 divisible by 8? No. Is 13 divisible by 9? No. Is 13 divisible by 10? No. Is 13 divisible by 11? No. Is 13 divisible by 12? No.

So, 13 is a prime number. Hooray!!

The repeated process above can be used by you to create a program to determine whether or not a number is prime. If you notice, there are some calculations in the above list that aren’t necessary to perform. The reason is that you don’t have to divide 13 by 7, 8, 9, 10, 11, or 12.

In order to determine if a number is prime, you only have to divide it by the numbers up to half of it’s value.

The following program outputs a message identifying whether or not a number entered by the user is prime. Pay close attention to the steps involved in determining whether or not a number is prime. See how valuable the % arithmetic operators can be in programming?

## Fibonacci Sequence

The Fibonacci sequence of numbers is a sequence that begins with 0 and 1.

0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 …

The next number in the sequence is always the two previous numbers, added together:

“ Written as a rule, the fibonacci sequence is x n = x n-1 + x n-2 ~ LiveScience

The Fibonacci sequence is sometimes drawn as a spiral:

The following short video does a great job of explaining how scientists and mathematicians have found the Fibonacci sequence, or spiral, represented in nature:

When you look at any two successive numbers in the Fibonacci sequence, their ratio gets closer and closer to what is known as the golden ratio, which is approximately 1.618.

Let’s take a look:

3/2 = 1.33333

5/3 = 1.666666

13/8 = 1.625

21/13 = 1.61538461538

34/21 = 1.61904761905

55/34 = 1.61764705882

89/54 = 1.61818181818

The golden ratio is an important concept in design, art, and, as you’ve already seen, in nature.

You can read more about the golden ratio and the Fibonacci sequence here:

- Golden Ratio in Architecture
- Math is Fun: The Golden Ratio
- Math is Fun: Fibonacci Sequence
- LiveScience: Fibonacci Sequence

Think About It...

The Fibonacci sequence obviously progresses as a pattern. The next Fibonacci number is found by adding up the two numbers that come before it.

In other words, the number you are searching for = the number that comes before it + the number that comes before that.

“Written as a rule, the expression is x n = x n-1 + x n-2 ” (from LiveScience ).

Can you think about an algorithm that could be used in a computer program to output the Fibonacci sequence?

Seems like a for loop might be useful, and maybe three variables that could hold

- the number you are looking for (x n ).
- the number that comes before it (x n-1 ).
- the number that comes before that (x n-2 ).

Another option is to create a recursive algorithm. Recursion is "the process of defining a problem in terms of itself." (From the School Of Computing - University of Utah ). It's sort of like creating a method that would call itself continously, until it reaches a base case. Sounds weird, but it's actually quite interesting, and it's a very important computer science concept. You can read more about it at the Khan Academy .

## CONSOLIDATION

It’s now time to put all of your algorithm design skills to the test. Your task is to create, design and test a program that involves factorials, prime numbers and Fibonacci sequences. It should all be laid out using a beautiful GUI!

If you’re worried about it all, just remember to

- break everything up into small steps.
- review past activities for code, commands and debugging tips.
- take the time to properly design the algorithms beforehand.
- program in small steps (get one part working first, then add the next part).
- think carefully about your test plan.

## Algorithm Design

Create a program that

- prompts the user for a number and finds the factorial of the number (e.g., User enters 7 and program outputs 5040).
- prompts the user for a number and determine whether or not the number is prime (e.g., User enters 471 and program outputs “No”, user enters 751 and program outputs “Yes”.)
- prompts the user for a number and outputs the Fibonacci number at that location (e.g., User enters 16 and program outputs 610).

Your program should use a GUI that resembles the following:

Each of the three tasks (factorial, prime and Fibonacci) should be implemented in your program as a subroutine. When the user clicks the appropriate button, the correct subroutine should be called.

Before beginning the program, create a flowchart for each of the subroutines. Once that is done, combine your subroutine flowcharts into one large flowchart for the entire program.

Create a test spreadsheet for your program and list appropriate test inputs and expected outputs. Complete your test plan, indicating actual outputs and any fixes that were required. Your test plan can be created with word processing or spreadsheet software. You can use this one as a template .

## Learning Goals and Success Criteria

Learning skills and work habits.

## Algorithm Design and Problem-Solving

- Structure Diagrams
- Top-Down Design
- Trace Tables (Algorithm Dry Runs)
- Algorithm Design

## Other Topics

- All Quizzes
- Computer Science Glossary
- Our YouTube Channel
- GCSE GURU Revision Tips +

## Small Print

- Cookie Policy
- Privacy Policy
- Terms and Conditions

## Downloads Shop

- Information & Terms

Copyright © Computer Science GCSE GURU

- 1. Micro-Worlds
- 2. Light-Bot in Java
- 3. Jeroos of Santong Island
- 4. Problem Solving and Algorithms
- 5. Creating Jeroo Methods
- 6. Conditionally Executing Actions
- 7. Repeating Actions
- 8. Handling Touch Events
- 9. Adding Text to the Screen

## Problem Solving and Algorithms

Learn a basic process for developing a solution to a problem. Nothing in this chapter is unique to using a computer to solve a problem. This process can be used to solve a wide variety of problems, including ones that have nothing to do with computers.

## Problems, Solutions, and Tools

I have a problem! I need to thank Aunt Kay for the birthday present she sent me. I could send a thank you note through the mail. I could call her on the telephone. I could send her an email message. I could drive to her house and thank her in person. In fact, there are many ways I could thank her, but that's not the point. The point is that I must decide how I want to solve the problem, and use the appropriate tool to implement (carry out) my plan. The postal service, the telephone, the internet, and my automobile are tools that I can use, but none of these actually solves my problem. In a similar way, a computer does not solve problems, it's just a tool that I can use to implement my plan for solving the problem.

Knowing that Aunt Kay appreciates creative and unusual things, I have decided to hire a singing messenger to deliver my thanks. In this context, the messenger is a tool, but one that needs instructions from me. I have to tell the messenger where Aunt Kay lives, what time I would like the message to be delivered, and what lyrics I want sung. A computer program is similar to my instructions to the messenger.

The story of Aunt Kay uses a familiar context to set the stage for a useful point of view concerning computers and computer programs. The following list summarizes the key aspects of this point of view.

A computer is a tool that can be used to implement a plan for solving a problem.

A computer program is a set of instructions for a computer. These instructions describe the steps that the computer must follow to implement a plan.

An algorithm is a plan for solving a problem.

A person must design an algorithm.

A person must translate an algorithm into a computer program.

This point of view sets the stage for a process that we will use to develop solutions to Jeroo problems. The basic process is important because it can be used to solve a wide variety of problems, including ones where the solution will be written in some other programming language.

## An Algorithm Development Process

Every problem solution starts with a plan. That plan is called an algorithm.

There are many ways to write an algorithm. Some are very informal, some are quite formal and mathematical in nature, and some are quite graphical. The instructions for connecting a DVD player to a television are an algorithm. A mathematical formula such as πR 2 is a special case of an algorithm. The form is not particularly important as long as it provides a good way to describe and check the logic of the plan.

The development of an algorithm (a plan) is a key step in solving a problem. Once we have an algorithm, we can translate it into a computer program in some programming language. Our algorithm development process consists of five major steps.

## Step 1: Obtain a description of the problem.

Step 2: analyze the problem., step 3: develop a high-level algorithm., step 4: refine the algorithm by adding more detail., step 5: review the algorithm..

This step is much more difficult than it appears. In the following discussion, the word client refers to someone who wants to find a solution to a problem, and the word developer refers to someone who finds a way to solve the problem. The developer must create an algorithm that will solve the client's problem.

The client is responsible for creating a description of the problem, but this is often the weakest part of the process. It's quite common for a problem description to suffer from one or more of the following types of defects: (1) the description relies on unstated assumptions, (2) the description is ambiguous, (3) the description is incomplete, or (4) the description has internal contradictions. These defects are seldom due to carelessness by the client. Instead, they are due to the fact that natural languages (English, French, Korean, etc.) are rather imprecise. Part of the developer's responsibility is to identify defects in the description of a problem, and to work with the client to remedy those defects.

The purpose of this step is to determine both the starting and ending points for solving the problem. This process is analogous to a mathematician determining what is given and what must be proven. A good problem description makes it easier to perform this step.

When determining the starting point, we should start by seeking answers to the following questions:

What data are available?

Where is that data?

What formulas pertain to the problem?

What rules exist for working with the data?

What relationships exist among the data values?

When determining the ending point, we need to describe the characteristics of a solution. In other words, how will we know when we're done? Asking the following questions often helps to determine the ending point.

What new facts will we have?

What items will have changed?

What changes will have been made to those items?

What things will no longer exist?

An algorithm is a plan for solving a problem, but plans come in several levels of detail. It's usually better to start with a high-level algorithm that includes the major part of a solution, but leaves the details until later. We can use an everyday example to demonstrate a high-level algorithm.

Problem: I need a send a birthday card to my brother, Mark.

Analysis: I don't have a card. I prefer to buy a card rather than make one myself.

High-level algorithm:

Go to a store that sells greeting cards Select a card Purchase a card Mail the card

This algorithm is satisfactory for daily use, but it lacks details that would have to be added were a computer to carry out the solution. These details include answers to questions such as the following.

"Which store will I visit?"

"How will I get there: walk, drive, ride my bicycle, take the bus?"

"What kind of card does Mark like: humorous, sentimental, risqué?"

These kinds of details are considered in the next step of our process.

A high-level algorithm shows the major steps that need to be followed to solve a problem. Now we need to add details to these steps, but how much detail should we add? Unfortunately, the answer to this question depends on the situation. We have to consider who (or what) is going to implement the algorithm and how much that person (or thing) already knows how to do. If someone is going to purchase Mark's birthday card on my behalf, my instructions have to be adapted to whether or not that person is familiar with the stores in the community and how well the purchaser known my brother's taste in greeting cards.

When our goal is to develop algorithms that will lead to computer programs, we need to consider the capabilities of the computer and provide enough detail so that someone else could use our algorithm to write a computer program that follows the steps in our algorithm. As with the birthday card problem, we need to adjust the level of detail to match the ability of the programmer. When in doubt, or when you are learning, it is better to have too much detail than to have too little.

Most of our examples will move from a high-level to a detailed algorithm in a single step, but this is not always reasonable. For larger, more complex problems, it is common to go through this process several times, developing intermediate level algorithms as we go. Each time, we add more detail to the previous algorithm, stopping when we see no benefit to further refinement. This technique of gradually working from a high-level to a detailed algorithm is often called stepwise refinement .

The final step is to review the algorithm. What are we looking for? First, we need to work through the algorithm step by step to determine whether or not it will solve the original problem. Once we are satisfied that the algorithm does provide a solution to the problem, we start to look for other things. The following questions are typical of ones that should be asked whenever we review an algorithm. Asking these questions and seeking their answers is a good way to develop skills that can be applied to the next problem.

Does this algorithm solve a very specific problem or does it solve a more general problem ? If it solves a very specific problem, should it be generalized?

For example, an algorithm that computes the area of a circle having radius 5.2 meters (formula π*5.2 2 ) solves a very specific problem, but an algorithm that computes the area of any circle (formula π*R 2 ) solves a more general problem.

Can this algorithm be simplified ?

One formula for computing the perimeter of a rectangle is:

length + width + length + width

A simpler formula would be:

2.0 * ( length + width )

Is this solution similar to the solution to another problem? How are they alike? How are they different?

For example, consider the following two formulae:

Rectangle area = length * width Triangle area = 0.5 * base * height

Similarities: Each computes an area. Each multiplies two measurements.

Differences: Different measurements are used. The triangle formula contains 0.5.

Hypothesis: Perhaps every area formula involves multiplying two measurements.

## Example 4.1: Pick and Plant

This section contains an extended example that demonstrates the algorithm development process. To complete the algorithm, we need to know that every Jeroo can hop forward, turn left and right, pick a flower from its current location, and plant a flower at its current location.

## Problem Statement (Step 1)

A Jeroo starts at (0, 0) facing East with no flowers in its pouch. There is a flower at location (3, 0). Write a program that directs the Jeroo to pick the flower and plant it at location (3, 2). After planting the flower, the Jeroo should hop one space East and stop. There are no other nets, flowers, or Jeroos on the island.

## Analysis of the Problem (Step 2)

The flower is exactly three spaces ahead of the jeroo.

The flower is to be planted exactly two spaces South of its current location.

The Jeroo is to finish facing East one space East of the planted flower.

There are no nets to worry about.

## High-level Algorithm (Step 3)

Let's name the Jeroo Bobby. Bobby should do the following:

Get the flower Put the flower Hop East

## Detailed Algorithm (Step 4)

Get the flower Hop 3 times Pick the flower Put the flower Turn right Hop 2 times Plant a flower Hop East Turn left Hop once

## Review the Algorithm (Step 5)

The high-level algorithm partitioned the problem into three rather easy subproblems. This seems like a good technique.

This algorithm solves a very specific problem because the Jeroo and the flower are in very specific locations.

This algorithm is actually a solution to a slightly more general problem in which the Jeroo starts anywhere, and the flower is 3 spaces directly ahead of the Jeroo.

## Java Code for "Pick and Plant"

A good programmer doesn't write a program all at once. Instead, the programmer will write and test the program in a series of builds. Each build adds to the previous one. The high-level algorithm will guide us in this process.

## FIRST BUILD

To see this solution in action, create a new Greenfoot4Sofia scenario and use the Edit Palettes Jeroo menu command to make the Jeroo classes visible. Right-click on the Island class and create a new subclass with the name of your choice. This subclass will hold your new code.

The recommended first build contains three things:

The main method (here myProgram() in your island subclass).

Declaration and instantiation of every Jeroo that will be used.

The high-level algorithm in the form of comments.

The instantiation at the beginning of myProgram() places bobby at (0, 0), facing East, with no flowers.

Once the first build is working correctly, we can proceed to the others. In this case, each build will correspond to one step in the high-level algorithm. It may seem like a lot of work to use four builds for such a simple program, but doing so helps establish habits that will become invaluable as the programs become more complex.

## SECOND BUILD

This build adds the logic to "get the flower", which in the detailed algorithm (step 4 above) consists of hopping 3 times and then picking the flower. The new code is indicated by comments that wouldn't appear in the original (they are just here to call attention to the additions). The blank lines help show the organization of the logic.

By taking a moment to run the work so far, you can confirm whether or not this step in the planned algorithm works as expected.

## THIRD BUILD

This build adds the logic to "put the flower". New code is indicated by the comments that are provided here to mark the additions.

## FOURTH BUILD (final)

Example 4.2: replace net with flower.

This section contains a second example that demonstrates the algorithm development process.

There are two Jeroos. One Jeroo starts at (0, 0) facing North with one flower in its pouch. The second starts at (0, 2) facing East with one flower in its pouch. There is a net at location (3, 2). Write a program that directs the first Jeroo to give its flower to the second one. After receiving the flower, the second Jeroo must disable the net, and plant a flower in its place. After planting the flower, the Jeroo must turn and face South. There are no other nets, flowers, or Jeroos on the island.

Jeroo_2 is exactly two spaces behind Jeroo_1.

The only net is exactly three spaces ahead of Jeroo_2.

Each Jeroo has exactly one flower.

Jeroo_2 will have two flowers after receiving one from Jeroo_1. One flower must be used to disable the net. The other flower must be planted at the location of the net, i.e. (3, 2).

Jeroo_1 will finish at (0, 1) facing South.

Jeroo_2 is to finish at (3, 2) facing South.

Each Jeroo will finish with 0 flowers in its pouch. One flower was used to disable the net, and the other was planted.

Let's name the first Jeroo Ann and the second one Andy.

Ann should do the following: Find Andy (but don't collide with him) Give a flower to Andy (he will be straight ahead) After receiving the flower, Andy should do the following: Find the net (but don't hop onto it) Disable the net Plant a flower at the location of the net Face South

Ann should do the following: Find Andy Turn around (either left or right twice) Hop (to location (0, 1)) Give a flower to Andy Give ahead Now Andy should do the following: Find the net Hop twice (to location (2, 2)) Disable the net Toss Plant a flower at the location of the net Hop (to location (3, 2)) Plant a flower Face South Turn right

The high-level algorithm helps manage the details.

This algorithm solves a very specific problem, but the specific locations are not important. The only thing that is important is the starting location of the Jeroos relative to one another and the location of the net relative to the second Jeroo's location and direction.

## Java Code for "Replace Net with Flower"

As before, the code should be written incrementally as a series of builds. Four builds will be suitable for this problem. As usual, the first build will contain the main method, the declaration and instantiation of the Jeroo objects, and the high-level algorithm in the form of comments. The second build will have Ann give her flower to Andy. The third build will have Andy locate and disable the net. In the final build, Andy will place the flower and turn East.

This build creates the main method, instantiates the Jeroos, and outlines the high-level algorithm. In this example, the main method would be myProgram() contained within a subclass of Island .

This build adds the logic for Ann to locate Andy and give him a flower.

This build adds the logic for Andy to locate and disable the net.

This build adds the logic for Andy to place a flower at (3, 2) and turn South.

2.1.1 Problem-solving and design

• show understanding that every computer system is made up of sub-systems, which in turn are made up of further sub-systems

• use top-down design, structure diagrams, flowcharts, pseudocode, library routines and subroutines

• work out the purpose of a given algorithm

• explain standard methods of solution

• suggest and apply suitable test data

• understand the need for validation and verification checks to be made on input data (validation could include range checks, length checks, type checks and check digits)

• use trace tables to find the value of variables at each step in an algorithm

• identify errors in given algorithms and suggest ways of removing these errors

• produce an algorithm for a given problem (either in the form of pseudocode or flowchart)

• comment on the effectiveness of a given solution

2.1.2 Pseudocode and flowcharts

• understand and use pseudocode for assignment, using ←

• understand and use pseudocode, using the following conditional statements:

IF … THEN … ELSE … ENDIF

CASE … OF … OTHERWISE … ENDCASE

• understand and use pseudocode, using the following loop structures:

FOR … TO … NEXT

REPEAT … UNTIL

WHILE … DO … ENDWHILE

• understand and use pseudocode, using the following commands and statements:

INPUT and OUTPUT (e.g. READ and PRINT)

totalling (e.g. Sum ← Sum + Number)

counting (e.g. Count ← Count + 1)

• understand and use standard flowchart symbols to represent the above statements, commands and structures

Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites

## On a mission to end educational inequality for young people everywhere.

ZNotes Education Limited is incorporated and registered in England and Wales, under Registration number: 12520980 whose Registered office is at: Docklands Lodge Business Centre, 244 Poplar High Street, London, E14 0BB. “ZNotes” and the ZNotes logo are trademarks of ZNotes Education Limited (registration UK00003478331).

## Problem Solving: Algorithm design

Express the solution to a simple problem as an algorithm using flowcharts, pseudo-code or structured English and the standard constructs:

## Sequence [ edit | edit source ]

performing or operating each step consecutively in the order they arise

- include<stdio.h>

int main() {

## Selection [ edit | edit source ]

Selection is choosing a step

## Repetition [ edit | edit source ]

A sequence of steps that loop until a requirement is met

- Book:A-level Computing

## IMAGES

## VIDEO

## COMMENTS

The six steps of problem solving involve problem definition, problem analysis, developing possible solutions, selecting a solution, implementing the solution and evaluating the outcome. Problem solving models are used to address issues that...

Maytag washers are reliable and durable machines, but like any appliance, they can experience problems from time to time. Fortunately, many of the most common issues can be solved quickly and easily. Here’s a look at how to troubleshoot som...

Are you a beginner when it comes to solving Sudoku puzzles? Do you find yourself frustrated and unsure of where to start? Fear not, as we have compiled a comprehensive guide on how to improve your problem-solving skills through Sudoku.

Designing an Algorithm · 1. Use Top-down Design: · 2. Number the steps in the order that they will need to be executed: · 3. Create pseudocode for the algorithm

Algorithm Design and Problem-Solving theory and quizzes for Computer Science GCSE.

An algorithm is a plan for solving a problem. There are many ways to write an algorithm. Some are very informal, some are quite formal and mathematical in

IGCSE Computer Science 2023-25 - Topic 7: Video 1 - Algorithm Design & Problem-Solving: Life Cycle. 30K views · 1 year ago #IGCSE #Exams

solving a problem or sub-problem. Desirable Properties. Use a finite amount

A VLE covering the CIE iGCSE Computer Science.

This lesson is about chapter 7: Algorithms design and problem solving.In this lecture students will be able to learn about PDLC and its

Algorithm Design & Problem-Solving. Program Development Life Cycle (PDLC). Analysis; Design; Coding; Testing; Maintenance

Share your videos with friends, family, and the world.

Algorithm - a set of instructions independent of any programming language that calculates a function or solves a problem.

The problem space also includes knowledge-rich schemas such as divide and conquer that subjects incorporate into their algorithms. A particularly versatile