A computer cannot think. To get it to do any useful work, a computer must be provided with a program. A program is a list of instructions. Programming a computer is a lot more involved than simply writing a list of instructions.
Problem solving is a crucial component of programming.
Before we can write a program to solve a particular problem, we must consider carefully all aspects of the problem and then develop and organize its solution. Later you will spend more time removing the errors that inevitably will be present in your programs. Resist the tempation to start entering your program as soon as you have some idea how to write it. Instead, think carefully about the problem and its solution before you write any program instructions. Once you have written the program out, desk check your solution by carefully performing each instruction as the computer would.