Programming with Objects

Pages 4 (1004 words)
Download 0
Answer In all programming languages, it is a practice to declare variables along with their types. The reason for doing so is that when a variable is declared, the compiler reserves space for it in the memory.
It is also a practice to declare them along with the type of data they are intended to hold or store.


The arithmetic operators manipulate numerical values and the assignment operator stores a value to a variable.
Answer It is often a requirement of a program to group items of same type say sales of an item X in Northern Region in one element to achieve preciseness and to make programming clearer, therefore sometimes repetitive data structures like array are used to group items of same type. Also, separate declaration of data element of similar type would make a program long and difficult to understand.
Answer Record data structures , as the name suggests are the objects that implement a real life record for example the record would typically represent a students attributes ,like his roll number ,name , date of birth and marks obtained in a particular subject or subjects . Here various attributes like name, roll number, date of birth etc are different types of data elements, but they are grouped together through record data structures.
Answer If a programmer needs to implement programmatically a real life scenario, like maintaining a file of different students, and then perform operations like calculating their average age, or arranging their names alphabetically then he needs to combine repetitive and record data types to achieve the desired logic.
The packed attri ...
Download paper
Not exactly what you need?