C Programming Test 6 Theory of Programming
C Programming Test 6 Theory of Programming
Theory of programming
(16 marks)
2. List and explain the 3 main steps in the compilation process from clicking compile to running an
executable program.
(6 marks)
3. Sam wants to build a mobile application. Name 2 characteristics he should look for in a
programming language. Give a reason for your answer.
(4 marks)
4. Explain 2 ways a program can be made easier for a future programmer to update.
(4 marks)
2. (Total 30 marks)
a. Lexical Analysis - The source code is broken down into tokens (keywords, variables, operators) and
scanned. Syntax Analysis - The tokens are broken down into a parse tree
b. Semantic Analysis (Parsing) – is the process where the compiler checks if the tokens follow the grammar
rules (syntax) and if it makes logical sense.
c. Code Generation - The compiler translates the code into machine code (binary) and links libraries to
produce an executable program.
3.Cross-platform programming-A language like Flutter (Dart) or React Native (JavaScript) that allows apps to
run on both Android and iOS without rewriting the code. It reduces development time and effort compared to
writing separate Android (Java/Kotlin) and iOS (Swift) apps.
-High level of performance and efficiency- Languages like Swift (for iOS) and Kotlin (for Android) are
optimized for mobile devices and ensures a high level of performance. Mobile devices have limited resources
(CPU, battery) so efficient code would improve the app's speed and battery life.
4. Using proper documentation by writing clear comments and providing README files to assist future
programmers in understanding the code and making updates.
-Writing modular and well-structured code by breaking the code into separate functions which makes updates
easier.