0% found this document useful (0 votes)
3 views

Structured Programming Assignments

Uploaded by

denisnzyoka14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Structured Programming Assignments

Uploaded by

denisnzyoka14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MURANG’A TECHNICAL TRAINING INSTITUTE

DIPLOMA IN ICT (M23)

ASSIGNMENT 1

NAME: YUSUF LUCHENDO

REG NO: 1001

DATE: 10.06.2023

LEC NAME: MADAM MAARA


QN 1: DIFFERENTIATE BETWEEN PRIMARY AND SECONDARY STORAGE IN
A COMPUTER SYSTEM.

PRIMARY STORAGE SECONDARY STORAGE


● Can easily access data directly ● Can't access data directly through the
through the processing unit. processing unit.
● Has volatile memory which won't ● Non-volatile memory which even
access data incase of power single after power failure data are still
failure. accessible.
● Also known as Main memory or ● Also known as Supplementary or
Inner memory. Auxiliary memory.
● Accessible by data bus. ● Accessible by I/O channels.
● Small storage capacity hence can't ● Large storage capacity hence can
store much data. store much data.
● Pricier than secondary storage. ● Cheaper compared to primary
storage .

QN 2: OUTLINE THE ADVANTAGES AND DISADVANTAGES OF:

A. LOW-LEVEL PROGRAMMING LANGUAGES

ADVANTAGES DISADVANTAGES
● Provide direct control over ● Programmers must know deeply about
computer hardware. the computer hardware to interact
● Debugging is easy as it's closer to with it.
computer. ● No space for errors, programmers
● Sufficient memory management have to write error free code for the
enables programmers manage the computer hardware.
computer memory directly hence ● Time consuming, memory and
faster execution. complexity of instructions have to be
● Can write highly efficient code managed.
used in software that requires high ● Less portable and have to be hardware
efficiency. specific.

B. HIGH-LEVEL PROGRAMMING LANGUAGES


ADVANTAGES DISADVANTAGES
● Easy to read and understand. ● Requires more processing time to convert
● Can run on any system or code into machine code hence slower
multiple platforms without execution.
modifications. ● Less control results to difficulty in
● Efficient in memory usage and optimizing code for specific systems.
execution time. ● Use additional functions and structures to
organize code and requires higher
memory usage.

QN 3: OUTLINE DIFFERENCES BETWEEN A COMPILER AND AN


INTERPRETER

COMPILER INTERPRETER
● Takes an entire program as input. ● Takes a single instruction as input.
● Compiles programs every time. ● Converts higher level program into
lower level program every time.
● Display errors after checking the ● Display errors for every instruction.
whole program.
● Requires more memory for object ● Requires less memory.
code generation.
● Intermediate object code is ● No Intermediate object code is
generated. generated.
● Faster conditional control statements ● Slower conditions control statements
execution. execution.

QN 4: DIFFERENTIATE BETWEEN SYNTAX AND SEMANTICS OF A


PROGRAMMING LANGUAGE.
SYNTAX SEMANTICS
● Errors are easy to identify. ● Errors are hard to identify.
● Errors are encountered after program ● Errors are encountered at run
execution. time.
● Doesn't relate with meaning of the
statement. ● Relates with statement meaning.
● Defines rules and regulations that
help to write any statement in a ● The meaning of the associated
programming language. line of code in a programming
language.

QN 5: IN ATHLETICS TRACK EVENTS, MEDALS ARE AWARDED TO THE


FIRST 3 ATHLETES. POSITION 1 GETS A GOLD MEDAL, POSITION 2 GETS A
SILVER MEDAL, AND POSITION 3 GETS A BRONZE MEDAL.

A. WRITE A PSEUDOCODE TO REPRESENT THAT.

START

INPUT Position

IF Position 1

PRINT "Gold"

IF Position 2

PRINT "Silver"

ELSE IF Position 3

PRINT "Bronze"

END IF

STOP

B. DRAW A FLOWCHART TO REPRESENT THAT

You might also like