Tuesday, February 9, 2010

CS201 GDB

CS201 Introduction to Programming GDB Solution

“Although for consistent and reusable design we follow Object Oriented paradigms; “structured approach” has still its worth in some imperative and critical applications. Support or contradict this statement with solid arguments."

Answer:

Help 1

Structured Programming

Structured programming takes on the top-to-bottom approach.It splits the tasks into modular forms. This makes the program simpler and easier to read with less lines and codes.This type of program accomplishes certain tasks for that a specific reason.For example, invoice printers use structured programming. This type has clear, correct, precise descriptions.

Object Oriented Programming

This type of programming uses sections in a program to perform certain tasks.It splits the program into objects that can be reused into other programs.They are small programs that can be used in other software.Each object or module has the data and the instruction of what to do with the data in it. This can be reused in other software directly.

Help 2.

There are advantages as well as disadvantages to using either structured programming languages or object-oriented languages when developing an application. One of the more popular structured programming languages is known as Pascal (Wikipedia – Structured Programming, 2005). Pascal is often used to help teach programming to students in an educational format (Wikipedia – Pascal, 2005). In general terms, a structured programming language is laid out in a series of explicit statements and does not generally contain commands which redirect the execution of statements to other areas of the program (Wikipedia – Pascal, 2005). In comparison, object-oriented languages often contain a set of reusable modular components, which can be called to execute at various points throughout the program, without having to be completely rewritten. Some of the more popular object-oriented languages include Java and C++ (Wikipedia – Object-oriented Programming, 2005). There is an advantage to using structured programming when writing classes and complex functions are not necessary. It can take up more time and energy to develop classes rather than simply write a straightforward piece of code, which executes a specific set of commands. It depends on what the overall purpose of the program is. One of the main disadvantages to using a structured programming language versus an object-oriented language is that it is not ‘modular’. In other words, the code is not split up into reusable sections. The code is written and executed sequentially; therefore you may have redundant code. It may take longer to develop programs using structured language (What Is Object-oriented Programming?, 2000). One of the advantages to using object-oriented programming languages is that it is modular. It is possible to write a reusable piece of code, such as a function or a class, which can be used multiple times throughout a program without having to rewrite it (Cashman, Shelly, & Vermaat, 2004, p. 405). This can save the developer much time and effort in the development process. One of the possible disadvantages to using an object-oriented programming language is its sheer complexity. It is not typically recommended to use object-oriented languages when developing smaller, less complex programs or programs that are built to run on low powered computers (What Is Object-oriented Programming?, 2000).Considering the potential complexity of a filing system application, it would probably be recommended to use object-oriented technology. Also, being that application development using object-oriented languages can be done faster, this might save the developer’s time so that they could deliver the program to the client sooner (Cashman et al., 2004, p. 405).

No comments: