The Student Room Group

GCSE Computer Science

How are you supposed to draw decomposition diagrams in Computer Science? Some people say that they are supposed to represent functions. Others say that decomposition diagrams are supposed to represent subprograms and others say that they can be used to break down a program as much as I want to make it simpler. Could someone please clarify this? Also what exactly are sub-programs, please give me a clear definition on what "procedures" are. Thanks guys!
Reply 1
Original post by VoiidDev
How are you supposed to draw decomposition diagrams in Computer Science? Some people say that they are supposed to represent functions. Others say that decomposition diagrams are supposed to represent subprograms and others say that they can be used to break down a program as much as I want to make it simpler. Could someone please clarify this? Also what exactly are sub-programs, please give me a clear definition on what "procedures" are. Thanks guys!

So if you think back to your 3 elements of computational thinking, what is decomposition?
It's the breaking down of large problems into smaller more manageable problems. So the second statement is the correct one. However, if you wanted to can implement subprograms into it (but you don't have to).

Sub-programs are small pieces of code that run during a larger piece of code. They can be called upon at any point repeatedly. There are two types of sub-programs: functions and procedures. Whislt they both execute a specific sub-routine during a piece of code, functions have to return a value using the RETURN command, but procedures do not. They are both limited to the code (unless stored in a library) so their calculations will be deleted when the program finishes executing.

Hope this helps
Reply 2
THANK YOU SO SO SO MUCH FOR YOUR RESPONSE!!!!!! It clarified a bunch of questions I had. Thanks!

Quick Reply

Latest

Trending

Trending