100% Zufriedenheitsgarantie Sofort verfügbar nach Zahlung Sowohl online als auch als PDF Du bist an nichts gebunden 4.2 TrustPilot
logo-home
Andere

INF1511 EXAM PACK

Bewertung
-
Verkauft
-
seiten
100
Hochgeladen auf
11-01-2023
geschrieben in
2022/2023

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) (1) c) Motivate one benefit of usmg classes m programming 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 [10) Question 3 Object Orientation 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) (30]

Mehr anzeigen Weniger lesen
Hochschule
Kurs











Ups! Dein Dokument kann gerade nicht geladen werden. Versuch es erneut oder kontaktiere den Support.

Schule, Studium & Fach

Hochschule
Kurs

Dokument Information

Hochgeladen auf
11. januar 2023
Anzahl der Seiten
100
geschrieben in
2022/2023
Typ
Andere
Person
Unbekannt

Themen

Inhaltsvorschau

INF1511 EXAM PACK 2022

written by

StudyScene




www.stuvia.com




Downloaded by: tebzamabalane |
Distribution of this document is illegal

, Stuvia.com - The study-notes marketplace




INF1511

EXAM PACK




Downloaded by: tebzamabalane |
Distribution of this document is illegal

,! I I
I Stuvia.com - The 'study-notes marketplace
I
>


I I
I I : .


UNIVERSITY EXAMINATIONS UNIVERSITEITSEKSAMENS


UNlSAI~

INF1511 October/November 2019

Visual Programming I
Duration 2 Hours 70 Marks

EXAMINERS
FIRST MRSPMGOUWS
SECOND DRVZMZAZI

Closed book exammation

This examination question paper remains the property of the University of South Africa and may not be
removed from the exammatton venue




This exarrunatton question paper consists of 5 pages

Instructions
• Answer all the questions in the answer book
• Answers m pencil will not be marked.
• The marks are provided m brackets next to the questions
• Good luck!

Duration 2 hours
Marks 70




Downloaded by: tebzamabalane |
Distribution of this document is illegal

, Stuvia.com - The study-notes marketplace




2
INF1S11
OCTOBER/NOVEMBER 2019

Question 1 Multiple-choice questions [10]
.
INSTRUCTION· Select the correct OPTION
Question Options Answers
a) Comments m Python begin with a 1 #
2 II
3 *
4 &&&
b) What format code rs used to display 1 %a
ASCII code? 2 %s
3 %1
4 %c
c) The function which returns the data 1 datatype()
type of an object rs 2 type_()
3 obJect_O
4 data()
d) An example of an immutable 1 lists
sequence m Python rs 2 integers
3 stnngs
4 floats
e) The index value of the last element m 1 z
a hst rs 2 -1
3 0
4 1
f) rs a special method that rs 1 1mt
automatically invoked right after a 2 pnnt
new mstance of a class rs created 3 str
4 class
g) Which file access mode option 1 a+
opens a file for reading and 2 A
appends contents to the end of the 3 a
file? 4 r+
h) What will be the content of file 1 Tea Coffee Espresso
snackorder txt after the following 2 TeaCoffeeEsoresso
code has been executed? 3 TEA COFFEE ESPRESSO
4 Tea
f =open (" snackorder txt", "w+") Coffee
lst~['Tea', 'Coffee', 'Espresso' l
Espresso
f w£Ltelines(lst)
f close ()
1) A class that implements only the 1 data descriptor
_get_ method for an object rs 2 getter class
called a 3 fetch class
4 non-data-descriptor
J) What rs the output of 1 Tea
pr1nt(snack.get("Tea"))? 2 Tea 1
3 TEA
snack={ "Tea" .1, "Coffee" 2, 4 1
"Espresso" 3}
-




[Please Tum Over]

Downloaded by: tebzamabalane |
Distribution of this document is illegal
3,54 €
Vollständigen Zugriff auf das Dokument erhalten:

100% Zufriedenheitsgarantie
Sofort verfügbar nach Zahlung
Sowohl online als auch als PDF
Du bist an nichts gebunden

Lerne den Verkäufer kennen
Seller avatar
DrPhilip

Lerne den Verkäufer kennen

Seller avatar
DrPhilip Chamberlain College Of Nursing
Folgen Sie müssen sich einloggen, um Studenten oder Kursen zu folgen.
Verkauft
1
Mitglied seit
3 Jahren
Anzahl der Follower
1
Dokumente
331
Zuletzt verkauft
2 Jahren vor
best seller

Here you will find ; ALL DOCUMENTS, PACKAGE DEALS, FLASHCARDS AND 100% REVISED & CORRECT STUDY MATERIALS GUARANTEED A+. NB: ALWAYS WRITE A GOOD REVIEW WHEN YOU BUY MY DOCUMENTS. ALSO, REFER YOUR COLLEGUES TO MY DOCUMENTS. ( Refer 3 and get 1 free document). I AM AVAILABLE TO SERVE YOU AT ANY TIME WISHING YOU SUCCESS IN YOUR STUDIES. THANK YOU.

0,0

0 rezensionen

5
0
4
0
3
0
2
0
1
0

Kürzlich von dir angesehen.

Warum sich Studierende für Stuvia entscheiden

on Mitstudent*innen erstellt, durch Bewertungen verifiziert

Geschrieben von Student*innen, die bestanden haben und bewertet von anderen, die diese Studiendokumente verwendet haben.

Nicht zufrieden? Wähle ein anderes Dokument

Kein Problem! Du kannst direkt ein anderes Dokument wählen, das besser zu dem passt, was du suchst.

Bezahle wie du möchtest, fange sofort an zu lernen

Kein Abonnement, keine Verpflichtungen. Bezahle wie gewohnt per Kreditkarte oder Sofort und lade dein PDF-Dokument sofort herunter.

Student with book image

“Gekauft, heruntergeladen und bestanden. So einfach kann es sein.”

Alisha Student

Häufig gestellte Fragen