In: Computer Science
research on the following:
Algorithms
Flowcharts
Pseudocodes
Based on your research and readings, answer the following questions:
Do you think every program needs all three (algorithms, flowcharts, and pseudocodes) of them? Why or why not? Justify your answer with examples.
If you plan to create any two of them for a program, which one would you eliminate? Why?
You have read about fundamental data types in your book. Are these data types enough to represent all data, or do you think additional data types are needed? Why or why not? Explain your answer with examples.
Looking at the phases of program development, in which phase should the documentation be done? Why?
Algorithm: step by step problem solving procedure .
Algorithm can be represented in two ways.
Flowchart: pictorial representation of algorithm using geometrical diagrams like rectangle, circle, polygon etc.
Pseudocode: it is one way of representation of algorithm using combination of programming statements and English phrases. Pseudocode has specific notations.
Algorithm for linear search:
Pseudocode for linear search:
FUNCTION linearSearch(array, searchElement):
FOR index FROM 0 -> length(array):
IF array[index] == searchElement THEN
RETURN index
ENDIF
ENDLOOP
RETURN -1
END FUNCTION
2)
If I want to choose two of them from algorithm, flowchart, pseudocode I will choose algorithm, pseudocode . I will eliminate flowchart .Creating flowchart for some problems very complex. Flow chart uses different symbols, arrows to show sequence of instructions. It will consume lot of time and modifications are difficult.
Where as we can write algorithm, pseudocode easily compared to flowchart for complex problems.
3)
We need additional data types required to store some types of data. Some types of data needed special mechanism to maintain them.
If we want store details of employee under one variable which is not possible using primitive types. Because employee has many fields like name, salary, date of birth etc.
To store elements of different data types we use structures, unions .
Struct emp
{
Char string[];
Int age;
Float salary;
}e3;
Struct emp e1,e2;
4)
Documentation done on various phases of software development before product is delivered to a customer.
Documentation done on requirement analysis, design, testing, deployment phases.
At the deployment phase complete working of product is documented for user understanding process.