Program Development Cycle

  1. Review the Specification-In this phase, we define the problem statement and we decide the boundaries of the problem.
  2. Informal Design-Addresses WHAT need to be done. The informal design step lets you make changes in your plan before you invest too much time in one approach. There are two steps in the informal design that need to be completed frequently in a repeated cycle. List the major tasks  & List the subtasks
  3. Formal Design-Formal design addresses HOW it will be done. Formal design is a communication tool for program designers and coders. There are many possible program design tools available and this course will concentrate on two of them namely; Flowcharts and Pseudocodes. Desk check the design. Desk checking is the way to check the logic of the design.
  4. Code & Compile-Coding the program is simply translating each design statement into the proper syntax for the desired programming language. using programming languages like C, C++, Java etc.
  5. Test-That means we test the program whether it is solving the problem for various input data values or not.
  6. Maintain- During this phase, the program is actively used by the users. That means in this phase, the solution (program) is used by the end user. If the user encounters any problem or wants any enhancement, then we need to repeat all the phases from the starting, so that the encountered problem is solved or enhancement is added.

(If you have errors, go back to the task list, make the necessary changes, implement those changes in formal design, and try the desk checking again.)

Checklist for Preparing a Task List 
  1. What output do you need to generate? 
  2. What input do you have/ need? 
  3. What form will it be in? 
  4. Will the program have a list of tasks that needs to be done repeatedly (LOOP)?
  5. What are the other major tasks of the program?
Let’s Prepare a Cup of Milk Tea

  1. What output do you need to generate? A cup of tea
  2. What input do you have/ need?  Sugar, Milk, Tea, Water , Cup
  3. What form will it be in? Dry sugar, Tea bag, Milk powder, Boiled water , Empty cup
  4. Will the program have a list of tasks that needs to be done repeatedly (LOOP)?No
  5. What are the other major tasks of the program?
  • Take the empty cup 
  • Add milk powder in to the cup Add sugar in to the cup 
  • Add boiled water into the cup ▫ Stir 1 minute time 
  • Add tea bag in to the cup and keep 1 minute time 
  • Remove the tea bag from the cup 
  • Stir 1 minute time to mix tea with milk
Let’s Prepare a Cup of Milk Tea with a Condition

• Selection constructs using two building blocks; 
Condition that govern by the Boolean logic.
 “PERSONAL PREFERENCE” ▫ Possible actions under two alternative cases if possible. 
If “PERSONAL PREFERENCE” is 
  1. YES -You add sugar. 
  2. Else -You do not add sugar.
EX:-
  1. What output do you need to generate? A cup of tea
  2. What input do you have/ need?  Sugar, Milk, Tea, Water , Cup
  3. What form will it be in? Dry sugar, Tea bag, Milk powder, Boiled water , Empty cup
  4. Will the program have a list of tasks that needs to be done repeatedly (LOOP)?No
  5. What are the other major tasks of the program?
  • Take the empty cup 
  • Add milk powder into the cup 
  • User preference for adding sugar is  
    • Yes: Add sugar into the cup  
    • No: Do not add sugar into the cup 
  • Add boiled water into the cup 
  • Stir 1 minute time 
  • Add tea bag into the cup and keep 1 minute time 
  • Remove the tea bag from the cup 
  • Stir 1 minute time to mix tea with milk

Let’s Prepare a Cup of Milk Tea with More Control of Tasks  
• You have to add loops if you have repetitive tasks in your problem to be solved; 
e.g. adding sugar and adding milk powder 

• Loop constructs of five building blocks 
  1. Loop control variable 
  2. Initial value of the loop control variable 
  3. Loop control condition 
  4. Repetitive statements 
  5. Increment the loop control variable 
EX:- Add sugar in to the cup

  1. What output do you need to generate? A cup of tea
  2. What input do you have/ need?  Sugar, Milk, Tea, Water , Cup
  3. What form will it be in? Dry sugar, Tea bag, Milk powder, Boiled water , Empty cup
  4. Will the program have a list of tasks that needs to be done repeatedly (LOOP)Yes
    1. Loop control variable - Tea spoon count 
    2. Initial value of the loop control variable - 0 
    3. Loop control condition - tea spoon count == 3 
    4. Repetitive statements - Add a tea spoon of sugar 
    5. Increment the loop control variable - incrementing the tea spoon count
  5. What are the other major tasks of the program?
  • Take the empty cup 
  • Add milk powder into the cup 
  • User preference for adding sugar is  
    • Yes: 
      1. tea spoon count for sugar is 0 
      2.  Add a tea spoon of sugar 
      3. Increment the tea spoon count for sugar by 1 
(Increment the tea spoon count until count==3)
    • No: Do not add sugar into the cup 
  • Add boiled water into the cup 
  • Stir 1 minute time 
  • Add tea bag into the cup and keep 1 minute time 
  • Remove the tea bag from the cup 
  • Stir 1 minute time to mix tea with milk




The Structure Theorem

The structure theorem forms the basic framework for structured programming.
three basic control structures such as: 
  1.  Sequence 
  2. Selection 
  3. Repetition / Iteration
Sequence -The sequence control structure is the straight forward execution of one processing step after another.   
  1. Statement 1
  2. Statement 2
  3. Statement 3

Selection - The selection control structure is the presentation of a condition and the choice between two actions, the choice depending on whether the condition is true or false.

Repetition - The repetition control structure can be defined as the presentation of a set of instructions to be performed repeatedly, as long as a condition is true.


Comments