Docsity

Object-Oriented Programming: Fundamentals and Relationships, Summaries of Mathematics

Toggle sidebar
bg1
ASSIGNMENT 1 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 20: Advanced Programming
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Student ID
Class Assessor name
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P1 P2 M1 M2 D1 D2
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Object-Oriented Programming: Fundamentals and Relationships and more Summaries Mathematics in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid P1 P2 M1 M2 D1 D

❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

  1. Class A class is an entity that determines how an object will behave and what the object will contain. In other words, it is a blueprint or a set of instruction to build a specific type of object. It provides initial values for member variables and member functions or methods.
  1. Attribute Attributes, also known as instance variables or member variables, represent the state of an object. They are used to define the characteristics or properties of an object. Attributes store data that is specific to each instance of a class. Definition: Attributes are data members of a class. They represent what the object is or what it possesses. Purpose: Attributes describe the properties of an object. They define the data that an object can hold. Characteristics: Each object has its own set of attribute values, and these values can vary from one object to another. Data Storage: Attributes store data, and this data can be of various types, such as integers, strings, floats, or custom data types. Access Control: In many programming languages, you can specify access modifiers (e.g., public, private, protected) for attributes to control their visibility and accessibility from outside the class. Private attributes are typically not directly accessible from outside the class and are accessed through methods.
  1. Method. Methods are functions or procedures associated with a class. They define the behavior of objects and the actions that objects can perform. Methods operate on an object's attributes and can interact with other objects. Definition: Methods are functions that are members of a class. They represent what the object does or how it behaves. Purpose: Methods describe the actions and behavior of objects. They define the functionality that objects can exhibit. Access to Attributes: Methods have access to the attributes of the object to which they belong. They can read and modify these attributes as necessary to implement their functionality. Encapsulation: Methods, along with attributes, are used to encapsulate the internal state and behavior of an object. This helps in hiding the implementation details and providing a well-defined interface to interact with the object. Access Control: Methods can also have access modifiers to control their visibility. Public methods define the external interface to interact with the object, while private methods are used for internal class operations.
  2. The Relationship Between Methods and Attributes The relationship between methods and attributes is central to the concept of an object. Attributes represent the state of the object, describing its properties, while methods define the actions the object can perform based on that state. Encapsulation: The bundling of data (attributes) and the methods that operate on that data into a single unit (a class). Encapsulation ensures that the internal state of the object is protected, and the object's behavior is controlled through well-defined methods. Data Integrity: By accessing attributes through methods, OOP enforces data consistency and prevents unauthorized or unintended modifications to the object's state. This contributes to the reliability and predictability of the object's behavior. Modularity and Reusability: Objects, with their attributes and methods, serve as self-contained, reusable units. This modular design allows for efficient development and maintenance of software by building on existing classes and objects.