Epaphras Simango Programmming Assignment
Epaphras Simango Programmming Assignment
LECTURER : MR CHIBIDI I
ASSIGNMENT NO : 01
MARK : ……………………………….
……………………………….….
LECTURERS’ REMARKS:…………………………………………………………………..
………….……………………………………………………………………………………….
…….……………………………………………………………………………………………
QUESTION 1
Naming conventions for local variables, global variables, constants and functions:
Some of the naming conventions are given below:
Meaningful and understandable variables name helps anyone to understand the reason of using it.
Local variables should be named using camel case lettering starting with small letter (e.g. localData)
whereas Global variables names should start with a capital letter (e.g. GlobalData). Constant names
should be formed using capital letters only (e.g. CONSDATA).
It is better to avoid the use of digits in variable names.
The names of the function should be written in camel case starting with small letters.
The name of the function must describe the reason of using the function clearly and briefly.
Indentation:
Proper indentation is very important to increase the readability of the code. For making the code
readable, programmers should use White spaces properly. Some of the spacing conventions are
given below:
There must be a space after giving a comma between two function arguments.
Each nested block should be properly indented and spaced.
Proper Indentation should be there at the beginning and at the end of each block in the program.
All braces should start from a new line and the code following the end of braces also start from a
new line.
Programming languages are structured in different ways. Therefore, languages can be grouped
according to the way they are structured or designed simply known as paradigm. paradigms include;
3. Rule-based or logical languages: They support decision making based on the provided conditions
4. Object oriented languages: It is a paradigm that provides solutions that depict the real world
scenario. It emphasizes more on data. It uses the concept of classes where an object is seen in terms
of data (what it can process) and what it can do (methods).
5. Concurrent languages: They apply the concept of a process. A process corresponds to a sequential
computation, with its own thread of control.
3. Linking the program with functions that are needed from the C library 59
System Ready
Enter Program
Program Code
Source Program
Edit Source Program
Syntax Yes
errors?
No
No errors
Connect Output
Stop