IT/218
May 13, 2012
Farhad Malek-Asghar
When it comes to writing a program there are so many ways a person can approach the problem. Think of it this way, a chef following a recipe can look at the ingredients and decided to add more of one thing and less of another or the chef can follow the recipe exactly. As long as the chef uses common logic on blending foods the dish will come out correctly. The same is true when building a program. A programmer has many tools to choose from to make it more or less complicated. The programmer also has several tools to choose from to ensure the program runs. So let me go over some of these essential tools right now and how they relate to one another. The first tool a programmer has to work with is called Structures. According to Cprogramming.com (1997), "Structures are a way of storing many different values in variables of potentially different types under the same name. This makes it a more modular program, which is easier to modify because its design makes things more compact". So in retrospect they are inherently more useful when a lot of data needs to be grouped together like large databases. Next we have Classes. According to Cprogramming.com (1997), "Classes are collections of data related to a single object type. Classes not only include information regarding the real world object, but also functions to access the data, and classes possess the ability to inherit from other classes”. Try to think of Classes as a television. Public parts of the classes can relate to the parts of a television that people tend to use. An example of this would be the volume or channel changing buttons. Each function is essential in the overall operation of the television and so is true about Classes. Then you have Unions. According to Microsoft (2012), "A Union is a structure like type that is provided in C and C++ to enable efficient use of memory.
References: Cprogramming.com. (1997). Structures in C++. Retrieved from http://www.cprogramming.com Exforsys (2000). C++ Polymorphism. Retrieved from http://www.exforsys.com/tutorials/c-plus-plus/polymorphism-an-introduction.html Microsoft. (2012). Union (C++). Retrieved from http://msdn.microsoft.com/en-us/library/5dxy4b7b(v=vs.90).aspx Stroustrup, B. (1992). C++-The C++ Programming Language, Second Edition. Retrieved from http://www.objs.com/x3h7/cplus.htm