/* These are the 6 steps for solving the problem of finding the sum of 2 integer numbers */ Step 1: Define the problem requirement From the problem description, the requirement is very clear. The program accepts as its input data two integer numbers like 50 and 30. The program will output the sum of the two integer numbers. Step 2: Identifying problem components: This shows all input data, output data and relationships between input and output Data expressed in formulas. Input data: Number1, Number2 (integer); Output data: Sum (integer) Other data: Relationships: Sum = Number1 + Number2; Step 3: Break problem solution into small problem modules Because this problem is simple enough, we do not need to break this problem into small modules. This we shall do starting from Chapter 4. Step 4:Design the algorithm to solve the problem (I will follow the general algorithmic structure provided as slide 54 or on page 72 as Fig. 3.1 of book). MainAlgorithm { input data: Number1, Number2 (integer); output data: Sum (integer), Other data: /* Sequence of steps begins here */ Print("Welcome to the Adder Program"); Print("Please type two integer numbers like 5 and 10"); Read(Number1, Number2); /* now compute the output Sum */ Sum = Number1 + Number2; /* Now print the desired output for the user */ Print(" The sum of Number1 and Number2 = ", Sum); } Step 5: Implementation of the algorithm(this is designed using the general structure of a C program provided as slide 55 or on page 73 as Fig 3.2 of book) #include void main(void) { /* Program to find the sum of two given integers */ /* We first declare the input and output data */ int Number1, Number2; int Sum; /* Sequence of steps begins here */ printf("Welcome to the Adder Program \n"); printf("Please type two integer numbers like 5 and 10 \n"); scanf("%d %d", &Number1, &Number2); Sum = Number1 + Number2; printf(" The sum of %d and %d = %d \n", Number1, Number2, Sum); } Step 6: Testing and Verifying the solution for correctness. This traces through the algorithm and program to ensure that with a set of given input data they produce expected results. Assume we test the problem by inputing the values 5 and 10 for Number1 and Number2. At the beginning of the program all variables declared are reserved with the following initial values as indicated in the program: The CPU will execute the sequence of instructions as follows: a)First executable instruction scanf("%d %d", &Number1, &Number2) has the effect of reading 5 into Number1 and 10 into Number2; b)The next program instruction has the effect of placing the value 5 + 10 into memory cell labeled Sum; c)the last instruction displays the output result to the user as: The sum of 5 and 10 = 15. END