Vous êtes sur la page 1sur 5

Assignment 1 Part 1

Flow Chart and Pseudocode


Question 1
a. The Relationship Between The Linker Program and The Objet !ile Produed b" The
#ompiler
Linker Objet !ile
The $untion to link the objet $ile and
e%eutable $ile.
#ontain mahine ode that onl" omputer an
understand.
b. Pseudoode
Pseudoode is the use o$ an &nglish'like language and human an easil" understand it.
Bene$its o$ (sing Pseudoode)
The abilit" to understand the program
' Pseudoode is easil" to understand
Other programmer an re$er the pseudoode
' Allow other programmer to edit the program.
. Based on the $ollowing desriptions* draw the omplete $lowhart to determine human
pereption o$ noises based on the loudness o$ the noise +measured in deibels,.
-nitiali.e all /ariables.
0et the deibels amount $rom user.
1etermine the pereption that is assoiated with the noise le/el +as measured in
deibels,.
1ispla" pereption.
Loudness in Decibels(db)
Perception
23 or lower Quiet
21'43 -ntrusi/e
41'53 Anno"ing
51'113 6er" anno"ing
Abo/e 113 unom$ortable
Answer)
T
!
T
!
T
!
T
!
7TART
0&T deibels
db 8 9
23
1ispla" :6er"
Anno"ing;
1ispla" :Anno"ing;
1ispla" :-ntrusi/e;
1ispla" :Quiet;
1ispla"
:(nom$ortable
db 8 9
23
db 8 9
23
db 8 9
23
Question <
a. =ain !untion o$ a #ompiler
#reate e%eutable $ile
' Allow user to run the program
7a/e objet ode
' 7a/e time $or user to run the program
b. =ain 7tep in The Program 1e/elopment Li$e #"le +P1L#,
1. -denti$"ing the problem
<. Anal".e the problem
>. 1esign the algorithm
?. -mplement algorithm
2. Test program
. 1raw the $lowhart $or the $ollowing pseudoode.
&@1
BEGIN
Set ratings=0, name = Unknown, choice=X
no_colour = 0
Get name, choice

I! choice is e"ual to # then
$o
Get colour
%rint name an& colour
no_colour = no_colour ' (
)hile no_colour *=+
Else
Get ratings
I! ratings a,o-e +0
%rint name an& &anger
Else
%rint name an& normal
En&I!

En&I!
EN$
Answer)
!
T
T
!
Begin
ratings 9 3* name 9
:(nknown;* hoie 9 :A;*
@o olour 9 3
@o
olour 8
9 2
#hoie 9
A
0&T name* hoie
7how name* olour
@o olour 9 no olour B 1
0et ratings
!
T
Ratings
C 923
A
A
7how name* :danger;
&@1
7how name* :normal;

Vous aimerez peut-être aussi