Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Epaphras Simango Programmming Assignment

The document discusses a student's programming languages assignment which includes questions about coding best practices, programming paradigms, the C program execution process, and developing an ATM system flowchart.

Uploaded by

esimango
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Epaphras Simango Programmming Assignment

The document discusses a student's programming languages assignment which includes questions about coding best practices, programming paradigms, the C program execution process, and developing an ATM system flowchart.

Uploaded by

esimango
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

MUNHUMUTAPA SCHOOL OF COMMERCE

DEPARTMENT OF ACCOUNTING & INFORMATION SYSTEMS


NAME : EPAPHRAS SIMANGO

REG NUMBER : M101947

PROGRAMME : BCOM HONS INFORMATION SYSTEMS

LEVEL : 1.1 (BLOCK RELEASE)

MODULE TITLE : PRINCIPLES OF PROGRAMMMING LANGUAGES

MODULE CODE : ISH 112

LECTURER : MR CHIBIDI I

ASSIGNMENT NO : 01

MARK : ……………………………….

……………………………….….

LECTURERS’ REMARKS:…………………………………………………………………..

………….……………………………………………………………………………………….
…….……………………………………………………………………………………………
QUESTION 1

a) State and explain any 4 coding best practices? [4 marks]

Limited use of globals:


These rules tell about which types of data that can be declared global and the data that can’t be.

Standard headers for different modules:


For better understanding and maintenance of the code, the header of different modules should
follow some standard format and information. The header format must contain below things that is
being used in various companies:

Name of the module


Date of module creation
Author of the module
Modification history
Synopsis of the module about what the module does
Different functions supported in the module along with their input output parameters
Global variables accessed or modified by the module

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.

b) Explain the four types of programming paradigms. [8 marks]

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;

1. Imperative or procedural languages: is a type of imperative programming in which the program is


built from one or more procedures (also known as subroutines or functions).
2. Declarative languages: These languages contrast with imperative and procedural programming.
Declarative programming is a non-imperative style of programming in which programs describe their
desired results without explicitly listing commands or steps that must be performed.

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.

c. Describe the steps followed in the execution process of a C program.[6


marks]
The process of executing a program in C involves the following steps:

1. Creating the program

2. Compiling the program

3. Linking the program with functions that are needed from the C library 59

4. Executing the program

System Ready

Enter Program
Program Code
Source Program
Edit Source Program

C Compiler Compile Source Program

Syntax Yes
errors?

No

System libraries Link with System Libraries

Input data Execute Object Code


Logic errors
Logic and
Data Errors

No errors
Connect Output

Stop

d)You have been tasked to develop an Automated Teller Machine (ATM)


system. Develop a system flowchart showing how you can enquire
balance, successfully withdraw or transfer money between accounts.
[7 marks]
Automated Teller Machine (ATM) also known as ABM (Automated Banking
Machine) is a banking system. This banking system allows customers or users to have
access to financial transactions. These transactions can be done in public space
without any need for a clerk, cashier, or bank teller.

You might also like