0% found this document useful (0 votes)
29 views11 pages

Ict1511 2018 6 e 2

Introduction to Programming Unisa

Uploaded by

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

Ict1511 2018 6 e 2

Introduction to Programming Unisa

Uploaded by

gerryrushway
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 11
im UNISA 1CT1511 MAY/JUNE 2018 (PAPER 2) INTRODUCTION TO INTERACTIVE PROGRAMMING STUDENT NOWBER [| [2s] IDENTITY NUMBER INTRODUCTION TO INTERACTIVE PROGRAMMING Subject 1 Number of paper Date of exammation Examination centro WARNING. 1A candxate who without authonsaton takes ito the examination venue any Dodk, document o¢ object which could abet hen othe ‘examination ane dows not hand over such material i sho wwigatar before the flea! commencement of he examunaton wil De guy ot infnngeg the Univeratys examnston regulations aod wil be lable to punishment as determined by Counc! 2 Rough work may be done orly onthe exarnaton question paper and must be laoaled 2s Such 3 Nonotus may be made on any part ofthe body, such asthe hands or on any garment 4 Tras pagefpaper s the propery af the Unveray ane under no crcumstences may the candidate retain i of take i out of the examinston NB PLEASE COMPLETE THE ATTENDANCE REGISTER ON THE BACK PAGE, TEAR OFF AND HAND TO THE INVIGILATOR UNIVERSITY EXAMINATIONS. UNIVERSITEITSEKSAMENS. a ome UNISA tsa 1CT1511 Mayidune 2018 SECOND PAPER Introduction to Programming Duration — 2 Hours 90 Marks EXAMINERS IR MS ME VAN HEERDEN SECOND DRC VAN STAOEN, Closed book examination This examination question paper remains the property of the University of South Africa and may not be removed from the examination venue This paper consists of 6 pages + Appendix A (pp 7 - 10) INSTRUCTIONS 1 Answer question 1, 2, 3, and 4 in Appendix A 2 All rough work must be done on the back of this question paper and in the answer book 3. The mark for each question Is indicated in brackets next to the question GOOD LUCK Phe nc "a lorsstt Question 4 - True/False 115) Indicate whether the statement 1s true or false 1 The mathematical equation X = 17BC ~ B cannot be correctly interpreted by a computer When wniting an algorithm for a calculation, the programmer needs to ensure that the calculation has been done correctly, but do not necessarily need to know the result Deleting all unnecessary information from the problem statement can help you arrive at the crux of the problem A computer can assign a value to a variable by giving it an inttial value, assigning a value as a result of processing and keeping information for later use Both the while loop and the for loop are examples of pretest loops The for loop 1s a good too! when working with arrays because you frequently need to process every element of an array from beginning to end You use subscripts 1 through 10 to access the elements in a ten element array An insertion sort 1s another name for a bubble sort Modulanzation makes it harder for multiple programmers to work on a problem When different operators are combined in one expression, all the mathematical operators will be processed first, then the relational operators and finally the logical operators In a selection structure, you perform an action or task, and then you perform the next action in order The “then” part of an “if” statement will not be executed if the condition is true ‘As a general rule, an eof question should always come immediately after an input statement because the end-of-file condition will be detected at input Programmers can use either procedural programming or object-oriented programming to develop programs Declanng a class does not create actual objects 3 rera511 Question 2 - Multiple Choice [15] Identify the choice that best completes the statement or answers the question 4 Which of the following keywords indicates the mathematical operation of subtraction? a Combined b Product of c¢ Difference d Yields 2. The logic of an algonthm can be tested using a a trace table b desk checking ¢ walkthrough table d all of the above 3 Whats a set of instructions, in a specific sequence, used to solve a problem called? a planning b algorithm © pseudocode d Equations 4 When wnting pseudocode, there are two ways in which a computer can produce information, these are indicated by which of the following? a White/Display b Read/Enter ¢ Compare/Repeat d Calculate/Evaluate 5 Ina____, the loop body executes at least one time because the loop contro! variable is not tested until after one iteration a nested loop b pretest loop © posttest loop d loop control 6 The repetition of a series of steps is called a(n) a repeat flow b loop c flow d infinite loop Phase ron 4 verisit 7 A(n)____ loop executes a predetermined number of times a terminal b indefinite ¢ Infinate d fixed count 8 Every array has a(n)__size a infinite b finite ¢ variable d constant 9 Array elements all have the same __ in common a pointer b memory location c value d data type 10 When the records in a file are sorted in order from lowest to highest values, the records are in __order a descending b bubble c ascending d merged 11 Depending on the programming language being used, modules are also known as a subroutines, procedures, or methods b subroutines, receptacles, or methods cc tasks, functions, or methods d procedures, functions, or containers 12 When a program has several modules calling other modules, programmers often use a program ____, which operates similarly to an organizational chart, to show the overall picture of how modules are related to one another a hierarchy chart b tree chart ¢ flow chart d data diagram 13 For maximum efficiency, a good rule of thumb in an AND decision is to a first ask the question that is more likely to be true b first ask the question that is more likely to be false ¢ rewntte it as an OR decision and ask the question more likely to be true d rewrite itas an OR decision and ask the question more likely to be false 5 lertsi1 even oet 14 When you ____a file, it 1s no longer available to your application a examine b rewrite c close d index 15 ___1s a programming model that focuses on an application's components and data and the methods you need to manipulate them a Classical programming b Functional programming ¢ Procedural programming d Object-oriented programming Question 3 - Completion {15] Complete each statement 4 ____are used in cases where we know that the value will never vary during the execution of the program 2 arithmetic is done when the user only wants to know what the value of the remainder is when dividing 3 When you structures, the statements that start and end a structure are always on the same level and always in pairs 4. The algonthm property for the last statement or step 1s always A(n) can contain any number of tasks, but there 1s no option to branch off and skip any of the tasks 6 Ina for statement, a loop control variable ts initialized, tested, and 7 Use a(n) to indicate the position of a particular item within an array 8 Allarray elements have the same ___name, but each individual element also has a unique subscript indicating how far away it 1s from the first element 9 Expressions that compare operands are called expressions 10 Some people call the selection structure a(n) statement 114A operator joins two Boolean expressions to yield a Boolean answer 12 When you store data In a computer file on a persistent storage device, you to the file 13 A(n) Is one instance of a class 6 rorts1 14 Another important concept in object-oriented programming 1s , which 1s the process of acquiring the traits of one’s predecessors 15 When you program in object-ortented languages, you frequently create from which objects will be instantiated Question 4 [45] 41 The identity numbers of eight employees in a particular company are stored in an array The manager wants to know if a specific woman Is a company employee by entering her identity number White the algorithm to achieve this goal (15] 4 nN Angle has offered to pick strawberries for her mother, who wants to make jam She needs between 4 5 and 5 5 kilograms of strawberries for the jam ‘Angle, who 1s only a iittle girl, can pick and carry between 400 and 900 grams of strawberries at a time, which she puts into her mother’s container on the scale The user is asked to enter the weight of the strawberries in grams each time Angel brings strawbernes The program must calculate and display how many times she has to go to the garden to pick strawberries before her mother has enough for jam The program must also display the total weight of the strawberries picked Do the planning, IPO and algorithm to achieve this goal [30] pendix A rerisis Question 1 - True/False Mark correct choice with X I 1/T/F 2/7 |F 3 [7 |F 4|7[F [s|T|F Cie AeT eRe 7[ TF a[t|r o9/Ttfr to | T | Fi u{[ tif F 2| Tif eF 3 [7 /| F 4{7T fF [is | TF Question 2 - Multiple Choice Mark correct choice with X 1[/alf[bifleld 2[ajbifel|d 3; a {b/c /| 4a 4[ajlb clad s|a|bfela 6 a|b.«|d 7 | a|bpfeljda s|al|btfilctl|d 9|al|bjfe|d 40 | a bic a | a [af| bic! d | alpifetl|d 13] a [|b | ec | da 44] afl pie la 1 [| afl bp |e |da Question 3 - Completion - Write down the correct phrase only a}ole|~lofe)a)o)n] = } 8 o S a 8 wert Question 4.1 9 leTss11 Pantene Question 4.2 ; <] Desenption Type Variable name Input | Output «Input : “Processing _ Output | PrEeeeHeeE eee a 4 10 terisit ° LUNISA 2018

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy