Wednesday, June 24, 2020

Array structure proposal Essay - 550 Words

Array structure proposal (Essay Sample) Content: Array Structure ProposalStudent NameInstitutionArray Structure ProposalObjectsIn programming and computer science, an object is defined as a location in memory (Knaster, Malik Dalrymple, 2012). The location has value and is always referenced by an identifier. There are different forms of objects from functions, data structures and variables. Objects are the basis upon which object oriented programing (OOP) languages are based. Object oriented programming involves designing software systems that are modular and reusable. The design uses a modelling approach where standard and good design principles are adopted. Object oriented programming has been extended from structured programming approach and the abstract data types (Knaster, Malik Dalrymple, 2012). The model is revolves around objects and data rather than actions and logic. While used in an OOP language, an object specifies an instance of a class or a specific type. The structure adopted by the object is univers al throughout the class. However, objects may differ based on characteristics. Depending on the programming language used, objects have the ability to call methods or functions that are specified for that object.Using OOP, a programmer can easily structure, organize and code massive programs. This is because an object is independent and can be modified without affecting the entire program. Updating and introducing changes to the objects is also easily done without affecting the program and this has enhanced software management and maintenance. In real life an object has properties or attributes and methods as shown in the example below.Object Properties Methods Car Name, model, color, weight, price Start, drive, brake, repair Dog Name, color, age, size Bark, sleep, run ArraysArrays are variables that are used to hold multiple values (Knaster, Malik Dalrymple, 2012). The number of variables to be stored in an array determines its size. Some programming languages such as C require t hat the size of an array be specified explicitly. An array is used for describing variables and values. The values are identified by indices (this are keys for identification). The indices are computed at the runtime or compilation of the program. All the components in an array are of the same type. In a programming language like Java, an array is considered an object. Example of declaration an array in java.int [ ] num= new int [5];From this example, it can be discovered that the following syntax has been used to declare an array.Data type [ ] array name;Array name= new data type [N]; where N initializes the number of variables in the array. After initialization and declaration, an array can be accessed in the following manner.Array name [index]; the index refers to the position of the variable in the array. An array can be initialized and declared at the same time as shown below.Double [ ] sales= {12, 24, 36.5};