INF1511 - Visual Programming I EXAM PACK 2022.
INF1511 - Visual Programming I EXAM PACK 2022. Question 1 Multiple-choice questions [10] INF1S11 OCTOBER/NOVEMBER 2019 2 Downloaded by: tebzamabalane | Distribution of this document is illegal S - The study-notes marketplace [Please Turn Over] e) A class may have two types of methods, namely class methods and static methods Briefly explain a difference between these two types of methods You may use a coded example to clarify ( 4) d) Explam why garbage collecnon rs required m programmmg You may use a coded example to clarify (1) c) Motivate one benefit of usmg classes m programming (1) b) Given the class definition above, explain how an instance of the class rs created You may use a coded example to clarify (2) class student: studentnum =0 studentorder = '' deli veryto = '' print (eryto) Identify the class object and a class (2) a) Consider the following code to define a class attribute Question 3 Object Orientation [10) d) Write a program that will ask the user to input words as two strings, and will assign the strings to variables word1 and word2 The program must jom the strings word1 and word2 with the Jom function with a space between the strings The output must be displayed m caprtal letters Please name the program and provide at least one code comment ( 10) c) Ask the user for a random number and assign the value to a variable named starting Then using a for loop and write a program that asks the user for input of 5 numbers Each of these numbers must be added to the m1t1al value of the variable starting. The output must be the mmal and final value of the variable starting. Please name the program and provide at least one code comment (5) b) Write a function thedifference Wnte a program that outputs the difference between the first and the second input numerical values The input values must be requested from the user The values must be passed to the function, and the difference value rs returned The output should reflect both the input and output values Please name the program and provide at least one code comment (10) a) Use an if ... else statement and write a program that asks the user for mput of the time m hours (1 to 24} for the day If the time value rs greater than 6 and less than 18, then the program must output a comment 'Have a Happy Day', else the comment must be 'Rest Well' Please name the program and provide at least one code comment (5) Question 2 Programming (30] INF1511 OCTOBER/NOVEMBER 2019 3 : I i : : I I I I I I ' I I : I . Downloaded by: tebzamabalane | Distribution of this document is illegal S - The study-notes marketplace [Please Turn Over] to learn 00 programming is amazing Easy development of the f .i Le are: Python web development The Output: The contents in Prograrruning and matters import sys matter2 = 11' The development of programming matters ''' f = open('', 'a' ) 1te("n%s" %matter2) f. close () f = open('', 1r' } lines= ines() f. close () print('The contents in the file are:') for line in lines: 1te(l1ne} c) Consider the code below, and explain each of the 12 Imes (6) include snippets of code with comments to enhance your explanation (2) b) Explain two ways m which content may be removed from a file You are welcome to a) Explain the concept of file handling (2) INF1511 OCTOBER/NOVEMBER 2019 Question 4 File Handling (10] 4 Downloaded by: tebzamabalane | Distribution of this document is illegal S - The study-notes marketplace Urusa 2019 © c) Sketch the user interface for the adrmrustratron of the student menu delivery request The information must be saved to a file You must label all widgets included on the UI Other details to be included on the user interface rncludes the order reference number, the student number, the student contact phone number, and the delivery address (5) b) The distance (to the nearest metre) between kitchen and delivery address rs entered The cost 1s calculated usmg this distance Which widget may be used on the UI to capture the distance and to calculate the cost of the delivery? Explain (4) a) Which widget may be used on the UI to capture the request status? Motivate (1) • The student delivery request status must change Options for request status are ordered, processed, or delivered • The cost of the delivery must be captured However, the StudentMenuDelivery application needs expansion to include a delivery fee and track a delivery Thus, a new user interface (UI) must be developed for the processing of a menu delivery request from a student The StudentMenuDelivery rs an innovative new system that allows students to order refreshments to their study desk The system will be piloted at selected campus soonest Question 5 Application Development [10] INFlSll OCTOBER/NOVEMBER 2019 5 I I ' . ; I . I I • Downloaded by: tebzamabalane | Distribution of this document is illegal S - The study-notes marketplace UNIVERSITY EXAMINATIONS UNIVERSITEITSEKSAMENS UNISA N Iszx. - INF1511 May/June 2019 Visual Programming| Duration 2 Hours 70 Marks EXAMINERS FIRST MRS PM GOUWS SECOND DR VZ MZAZI 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 examination question paper consists of 5 pages Instructions e Answerall the questions in the answer book e Answersin pencil will not be marked e The marks are provided in brackets next to the questions [Please Turn Over] Downloaded by: tebzamabalane | Distribution of this document is illegal S - The study-notes marketplace Question 1 Multiple-choice questions [10 Marks] INF1511 MAY/JUNE 2019 Question Options Answers 1 Yes 1 Is Python case sensitive when dealing with 2 No identifiers? 3 Machine dependent 4 Noneofthe above l keywords 2 are used for storing dataina 2 variables program 3 integers 4 comments 1 an error message 3 Ifthe data type of the values in the 2 an event handler variables does not match the format codes, 3 an auto conversion then occurs 4 nothing l Integrated Development Environment 4 IDLE 1s the abbreviation for 2 Incredible Development Environment 3 Integrated Development Experience 4 Integrated Distribution Environment l python 5 The extension for a Python program 1s 2 thon 3 py 4 pyt 1 pick and return a random item from a 6 The choice() function 1s used to sequence It can be used with lists, tuples 2 select the maximum number. or strings 3 select the optimalstring value 4 pick the median value 7. A string ‘ready’ is entered into a program : sorted) To generate the outputstring ‘adery’, the ts_Random() function is used 3 swapcase() —_= 4 IstripQ) l selfies 8 The functions that are defined in a class 2 Instances are known as 3 classes 4 methods. 1 Is used to store values 2 Never requires quotes 9 A Itteral value in a program 3 Must always have quotes. 4 occurs directly in a program 1 Only 10. The following 1s a keyword in Python 2 Class 3 Without 4 Within
Written for
- Institution
- University of South Africa
- Course
- INF1511 - Visual Programming I (INF1511)
Document information
- Uploaded on
- April 14, 2022
- Number of pages
- 100
- Written in
- 2021/2022
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
- exam pack 2022
- inf1511 exam pack 2022
-
inf1511 visual programming i exam pack 2022
-
inf1511 visual programming i exam pack
-
visual programming i exam pack 2022
-
inf1511 visual programming i exam pack