Course Title Design and Analysis of Algorithm
Assignment # 1
Submitted To Sir Tanveer Ahmed Siddiqui
Due Date 19-03-2013
For Odd Role Number Group
Q1. How does a flowchart help a programmer in a program development?
Ans. Flowcharts provide the visual representation of a concept and make it clear. A flow chart serves as a blueprint of the program. Flowcharts helps a programmer organize his/her thoughts in a logical order and their presentation. Program development without graphics may be less effective. In big projects it gets difficult to keep things together. Flowcharts provide flexibility, so that you can make changes and restructure the project as you move further and, according to requirement. Flowcharts act as a guide during the analysis and program development phase. Moreover they are also helpful in debugging process.
Q2. Draw a flowchart of the logical steps needed to produce a printed listing of all students over the age of 20 in a class. The input records contain the name and age of the students. Assume a sentinel value of 99 for the age field of the trailer record.
Sol.
Q3. The first 20 records in a data set are to be read and printed. Draw a flowchart for the algorithm to do this job. Make sure that the processing stops after the twentieth record.
Sol.
Q4. For the employees problem of Question 40 ( even group Q3), we want to count and print the number of only male employees in the age group of 25 to 30. Assume that the input records contain SexCode and Age fields to provide this information. Draw a flowchart for the algorithm to perform this job.
Sol.
Q5. A set of examination papers, which have been graded with scores form 0 to 100 is to be searched to find how many of them are above 90. The total has to be printed. Prepare a flowchart to do this job.