Writing An Algorithm
A programming task can be divided into two phases: Problem-solving phase - produce an ordered sequence of steps that describe the solution of a problem this sequence of steps is called an algorithm. Implementation phase - implement the program in some…