lOMoARcPSD|3204666
2024 Unit6 Classes - Visual Programming 1 (INF1511)
Visual Programming 1 (University of South Africa)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
INF1511 Unit 6
Visual Programming I
Classes
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Assumptions
• Installed Jupyter Notebook.
• Done the theory self-assessments for Units 1-5
• Watched all the recordings for Units 1-5.
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Overview Unit 6
• The theory of classes in programming.
• The practical application (and demonstration)
of classes in programming.
• The assessment of learning in this unit.
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Programming elements
• Literals - _______________________________________
• Variables - ______________________________________
• Keywords (30 in Python … and else elif exec … )
• Comments #
• A keyword is IF and ELIF
• A keyword is FOR
• A keyword is WHILE
• Functions are declared! The keyword is ……
• CLASS?
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Theory – What are classes in programming?
• Classes are ….
• A system. There is always input, processing
and output.
• A function has input, processing and output.
• A class has attributes and functions!
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Class – OO and re-use of code
• Define a class.
• A template/blueprint – DATA and OPERATIONS.
• Use the class attributes – variables (data
members) and methods (member functions).
• Define the functions in a class.
• From classes – create instances – objects.
• Classes can be independent or inherit (from a
base class).
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Class
• Access the class variables in instance
methods.
• Create a class instance.
• Initialize a class instance.
• Class and Static methods.
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
More Class
• Inheritance - single, multi-level and multiple.
• Control specifiers.
• Method overriding.
• Operator overloading.
• Polymorphism.
• Use of properties and descriptors.
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Assessment for Unit 6
• Theory MCQ quiz. Three attempts.
• Programming activities for this unit on Jupyter
Notebook page. Use to complete Assignment 6.
• Practical MCQ quiz (Assignment 6) available.
One attempt.
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Assessment Plan – NO EXTENSIONS
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Practical application
• Demonstrate the syntax and use of classes
• Using ANACONDA programming environment.
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)
lOMoARcPSD|3204666
Downloaded by Suretha Erasmus-Falgate (suretha.eras@gmail.com)