MCS-201 · Unit 1

Programming Fundamentals

Section 3 of 9

Block 1 · Unit 1Programming Fundamentals10 min · Section 3 of 9

1.3Top-Down Design

Covers IGNOU MCS-201 §1.3.4

Large problems are too big to hold in your head at once. Top-down design is a disciplined way to break them into pieces small enough to solve one at a time. It is also the reason C programs are built out of functions.

The idea

Top-down design is also called stepwise refinement, because each pass refines the previous one with more detail. While refining, you must also define how the sub-tasks pass data to each other, so the overall structure stays correct.

A reliable first level: Input → Process → Output

When you are unsure how to split a problem, start with three questions:

  1. Input: where does the data come from?
  2. Process: what must be calculated?
  3. Output: what must be shown or saved?

Then break each of these down again.

Print a student's mark sheet
1. Read data
  • Student details
  • Marks per subject
2. Calculate results
  • Total
  • Percentage
  • Grade, pass/fail
3. Print mark sheet
  • Header
  • Marks table
  • Result line
Mark sheet as a tree

Top-down versus bottom-up

AspectTop-downBottom-up
Starting pointThe whole problemSmall, reusable components
DirectionBreak downBuild up
Typical usePlanning procedural programs, such as CLibraries, object-oriented design
AdvantageThe overall structure is clear from the startComponents are well tested and reusable
RiskPieces may be hard to reuse elsewherePieces may not fit the final goal

In practice, programmers combine both: they plan top-down and build some reusable parts bottom-up.

Key takeaways

  • Top-down design starts with the whole problem and refines it step by step.
  • Input → Process → Output is a dependable first level.
  • Each lowest-level task usually becomes one function in C.
  • Bottom-up design builds from small components; real projects often use both.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

What is another name for top-down design?

Show answer

Answer: C. Stepwise refinement

Top-down design is also called stepwise refinement because each step is repeatedly refined into more detailed sub-steps. Bottom-up design is the opposite approach.

Question 2 · multiple choice

A design for “print a payslip” has only two steps: “read hours worked” and “calculate pay”. What is most clearly missing?

Show answer

Answer: B. An output step

The problem asks to print a payslip, but no step prints anything. Input (read hours) and a calculation are already present.

Question 3 · multiple choice

When should refinement stop in top-down design?

Show answer

Answer: D. When each sub-task can be written directly as program statements

Refinement continues until every sub-task is simple enough to code directly. There is no fixed number of levels.

Question 4 · multiple choice

Which statement best describes bottom-up design?

Show answer

Answer: A. It builds small components first and combines them into a complete solution

Bottom-up design starts from small, reusable parts. Starting from the whole problem describes top-down design.

Question 5 · multiple choice

In the mark sheet design, which level-2 task belongs under “Calculate results”?

Show answer

Answer: C. Percentage

Percentage is a calculation, so it belongs to the Process level. Reading details and marks belong to Input; printing the header belongs to Output.

Question 6 · short answer

Use top-down design to break “calculate and print an electricity bill” into two levels.

Show worked answer

Level 1 follows Input → Process → Output. 1. Read data: 1.1 read customer name and meter number; 1.2 read previous and current meter readings. 2. Calculate bill: 2.1 units ← current reading − previous reading; 2.2 energy charge ← units × rate per unit; 2.3 total ← energy charge + fixed charge. 3. Print bill: 3.1 print customer details; 3.2 print readings and units used; 3.3 print charges and total amount. Each level-2 task is small enough to become one function.

↑ ↓ move↵ openTab switch type