Anda di halaman 1dari 3

Trinity Ireland.

BSc. (Hons) in Computing, Year 1, (BSHC1) BSc. (Hons) in Business Information Systems, Year 1, (BSHBIS1) BA. In anagement of Tec!nology in Business, Year ", (BA TB") Hig!er Certificate in Computing, Year 1, (HCC1) BSc. (Hons) in Computing, #$ening, Year 1, (BSHC#1) BSc. (Hons) in Business Information Systems, #$ening, Year 1, (BSHBIS#1) Hig!er Certificate in Computing, #$ening, Year 1, (HCC#1) Semester %ne &epeat #'aminations ( ")1"*1+ ,ate TBC Time TBC ______________________________________________________________________

Introduction to -rogramming
[Click here and enter External Examiners Name] Ms. Frances Sheridan

Answer All Questions. Section 1 to e answered in the answer ooklet Section ! to e de"elo#ed and sa"ed on the exam dri"e $he use o% calculators is #ermitted ,uration of e'am. ! hours Attac!ments. N&A

'a(e 1 o% )

Section 1 ( to /e ans0ered in your ans0er /oo1let

(+) mar1s Total)

1. Examine the %ollowin( code se(ment and answer each o% the %ollowin( *uestions

Assumin( the user enters the num ers 1+, 1-, ), !, ., /, 10, !, 0, 1, 2 and -. a. 3hat will the out#ut e4 5- marks6 . 7llustrate with use o% a dia(ram, how the "alues would e stored in the #ro(ram 5- marks6 c. Ex#lain line 1 o% the code 5- marks6 d. Ex#lain what is ha##enin( in lines 11 to !0 o% the code 51- marks6

'a(e ! o% )

Section " ( to /e de$eloped and sa$ed on t!e e'am dri$e


1. Secret 8an(ua(e 9ecr:#tion

(2) mar1s Total)

Students in the local school ha"e een writin( notes in class in a new secret lan(ua(e and teachers are keen to decode the messa(es the: are sendin( each other. 7t would seem that what the: are doin( is #lacin( the %irst letter o% a word at the end o% the word and then addin( a: to the word. For exam#le, ;ello ecomes ello;a:. <ou ha"e een asked to de"elo# an a##lication that acce#ts one word in this encoded secret lan(ua(e %rom the teacher as in#ut. $he a##lication should then decode and out#ut the real word.

$he a##lication should make use o% instantia le classes. Name the classes ,ecoder1.3a$a and ,ecoder1App.3a$a 50+ marks6

!. Modi%: the a##lication de"elo#ed in *uestion 1 to allow the teacher to re#eat the #rocess to decode as man: words as the: like, one at a time. 3hen each word is decoded, the real word and its corres#ondin( word in the secret lan(ua(e should e stored in a !9 arra: called lo(. All contents o% the arra: should e #rinted %or the user when the: are %inished.

Sa"e the re"ised a##lication as ,ecoder".3a$a and ,ecoder"App.3a$a 5)+ marks6

'a(e ) o% )

Anda mungkin juga menyukai