Monday, 29 January 2018

Differ between cohesion and coupling and explain their types.

 Q1: What are the six types of the interaction coupling? Give one example of good interaction coupling  and one example of bad interaction coupling.
There are six types of interaction coupling:
Simply we can define Data coupling as the dependence of  software component on data not exclusively under the control of that  software component. It includes the local and global variables which are passed through parameters.
Stamp coupling is defined as it occurs between modules when data is passed by parameters using a data structure containing fields which may be used or not.
In control coupling in which one component of the software influences the execution of another software component. control coupling occurs when one module passes data that is used to control the flow of execution of another module.
In Common data coupling we can use global data as  communication between the modules.
Content coupling is defined as the module refers to the inside of another module. It changes the internal working  of another module.
No data coupling:
When modules don’t depends on other modules simply we can say independent modules:
 Example of good interaction coupling : Data coupling is the best.
Object to pass the value of a variable along with a message. i.e. The object invoice could send a calculate tax the taxable amount .
Example of bad interaction coupling: Content coupling is the worst interaction coupling.
Where a global data area exists outside the objects. i.e. A table users preference may simply be available for access and change by a variety of objects.

Q2: What are the seven types of method cohesion?
Seven types of method cohesion:
In this type of cohesion there is no specific relationship between the modules.
Coincidental  cohesion is when parts of module are grouped arbitrarily only relationship between the parts they grouped together.
A module that only has coincidental cohesion is one supporting tasks that  have no meaningful relationship to another.
Functional :
In this type of cohesion no element doing unrelated activities.
A functionally cohesive module is when parts of a module are grouped because they all contribute to a single well defined tasks of the module i.e. lexical analysis of XML string. Object oriented languages support this level of cohesion.
When parts of module are grouped because the output from one part is the input to another part like an assembly line. For example we can say a function which reads data from a file and process the data.
It has good coupling and is easily maintained.
A module is said to be Communicationally cohesive  If all functions of the module refers to the same data structure or we can simply elaborate as   is one which performs several functions on the same input or output data.
In this cohesion elements are unrelated. We can explain as When parts of modules are grouped because  they allows to follow a  certain sequence of execution and commonly found at the top of the hierarchy such as the main program. steps have to be carried out for achieving an objective.
Communicationally cohesive module is one whose elements perform different functions , but each function references the same output.
A logical cohesion is when parts of  module are grouped because they are logically categorized to do the same thing if they are different by nature.
Example of good method cohesion  : Functional cohesion is best
An object calculate tools may keep running total of the quantity times price subtotal for each item .
Example of bad method cohesion  : Coincident cohesion is worst
Unrelated activities  in the same method.

Tuesday, 17 October 2017

History of C++ programming language? Seven(7) Things that you didn’t know about C++ Programming

History  of  C++ :
The  C  programming  language  was  devised  in the  early 1970s  by  Dennis  M. Ritchie  an  employee  from  Bell  Labs  (AT&T).  
Many  other  programming  languages  are  derived  from  the  C  language.  Some  did  well  and some  did  not.  The languages  Objective-C  and  C++  for  instance  are  derived  from  the  C language.  Both  languages  add  the  “object oriented”  element  to  the  language  C.  One  of  the  most  recent  languages,  that  used  much  of  the  C  language,  is Java.
The  programming  language  C++  (originally  named  “C  with  Classes”)  was  devised  by Bjarne  Stroustrup  also  an  employee  from  Bell  Labs  (AT&T).  Stroustrup  started  working on  C  with  Classes  in  1979.
The  first  edition  of  Stroustrup's  book,  The  C++  Programming  Language,  was  published in  early  1986.  After  the  release  of  Version  2.0  in  1989,  C++  was  rapidly  acknowledged as  a  serious,  useful  language.  Work  began  that  year  to  establish  an  internationally recognized  language  standard  for  it.  In  1990,  “The  Annotated  C++  Reference  Manual” was  published.  This  work  became  the  basis  for  the  future  standard.  (Keep  in  mind  that there  were  additions  to  the  language  after  1990).  In  1997,   a  committee  of  the  American National  Standards  Institute  (ANSI)  completed  and  published  internally  the  Draft  Standard  -  The  C++  Language,  X3J16/97-14882,  Information  Technology  Council (NSITC),  Washington,   DC.
As  you  can  see  it  took  a  long  time  (almost  20 years)  to  come  to  a  standardized  version of  the  language.  In  2003  the  committee  published  a  corrected  version  of  the  C++  standard.
Ongoing  work  to  refine  the  standard  is  being  done  by  the  ISO  with  the  International Electro  technical  Commission (IEC),  an  international  standards  and  conformity  assessment body  for  all  fields  of  electrotechnology.  In 2005,  a  Technical  Report  1 , also  known  as "tr1"  was  published,  containing  many  extensions  to  the  C++  language  and  standard library.  In 2010,  the  international  standardization  working  group  on  C++  was  named ISO/IEC JTC1/SC22/WG21.
History Partiton :
From  the  above  discussion  history  can  be  divided  into  two  parts :
11)      Early C++             2) Standard C++
13)    Early C++ :

             In  1979,  New  features  was  introduced  like classes,  member  functions,  derived classes ,  separate  compilation,  public  and  private  access  control,  friends  function  and classes, ,  type  checking  of  function  arguments,  default  arguments,  inline  functions, overloaded   assignment  operator,  constructor,  destructor,   f()  same  as  f(void),  call-function and  return-function  (synchronization  features,  not  in  C++).  Libraries:  the  concurrent  task library  these  libraries  not  in  C++.
 In 1982,  C  was  introduced  with  Classes  reference  manual  published.
 In 1984  C84  implemented,  reference  manual  published.
In 1985  Cfront 1.0  was  introduced  with  additional  features  as  described  below,
New  features  includes  virtual  functions,  function  and  operator overloading,  references,  new  and  delete   operators ,  the  keyword  const,  scope  resolution operator,
Library  additions:  complex,  string,  iostream. It  was 1st  edition  of  The  C++ Programming  Language.

       In 1989  Cfront 2.0  was  introduced  with  additions  of  new  features.
New  features  includes  multiple  inheritance,  pointers  to  members,  protected  access, type-safe  linkage,  abstract  classes,  static  and  const  member  functions,  class-specific  new  and  delete
Library  additions:  I/O  manipulators.
      In 1991  Cfront 3.0  was  released.  That  was  2nd  edition  of  The  C++  Programming Language.

2)    Standard C++ :
In  1990  American  National  Standards  Institute:  ANSI  C++  Committee  founded.
In  1991  ISO  International  Organization   for  Standardization  C++   Committee  founded.
       In  1992  STL  Standard  Template  Library  implemented  in  C++.
       In1998  C++98  (ISO/IEC 14882:1998)  was  released  with  additions  of  new  features.
       This  is  3rd  edition  of  the   C++    Programming  Language.
New features:  RTTI  (dynamic _ cast,  typeid) ,  covariant  return  types,  cast operators,  mutable,  bool,  declarations  in  conditions,  template  instantiations,  member  templates,  export
Library  additions:  containers, algorithms,  iterators,  function  objects  (based on  STL),  locales,  bitset,  valarray,  auto _ ptr,  templatized  string,  iostream,  and  complex.

7 Things that you didn’t know about C++ Programming
Originally   created  in  the early 1980s,  C++  is  a  general  purpose,  object  oriented programming  language  that  supports  generic  programming  and  low-level  memory manipulation.  The  language  was  designed  with   an  emphasis  on  system  programming  and embedded  large  system.  Today  we’re  going  to  reveal  some  fun  facts  about  C++ ,  some of  which  may  surprise  you.
1.      C++  Influenced  Many  Other  Programming  Languages
According  to  Wikipedia,  C++  has  influenced  many  other  programming  languages,  some  of  which  include  C# ,  java  and  even  newer  versions  of  C.  If  C++   was  never  created, who  knows  what  these  programming  languages  would  look  like  today.
2.      C++  was  Originally  Called  ‘The  New  C’
Computer  programmer  Rick  Mascitti  is  credited  with  giving  C++  its  name,  with  the  ++ indicating  an  improvement  from  C  programming.  But  before  it  was  given  this  name,  C++   was  actually  referred  to  as  “the  new  C.”   This  is  because  C++   draws  inspiration from   C,  building  upon  its  framework  while  adding  new  features  and  functions  to  the language.
3.      C++   Introduces  Object-Oriented  Programming
Although  it  was  lacking   in  C,  object-oriented  programming  was  introduced  in  C++. Among  other  things,  C++  supports  the  four  primary  features  of  OOP:  abstraction, inheritance,  polymorphism  and  encapsulation.  With  that  said,  C++  is  unique  in  the  sense that  it  supports  deterministic  destructors  for  classes  —  a  feature  that’s   not  found  in  other   OOP  languages.
4.      C++  has  More  than  35  Operators
C++  currently  has  more  than  35  different  operators,  ranging  from  arithmetic  and  bit manipulation  to  logical  operations,  comparisons  and  more. Virtually  all  of  these  operators can  be  overloaded  for  specific  types,  although  there  are  a  few  exceptions,  one  of  which is  the  conditional  operator.  This  vast  array  of  operators  makes  C++   user  definitions  more  like  built-in  types.
5.      C++  has  Two  Main  Concepts
C++  has  two  primary  concepts  on  which  the  language  was  built:  direct  mapping  for hardware  features  and  zero-overhead  abstractions  for  mapping.  Perhaps  this  is  why  the language  is  often  touted  as   a  lightweight  abstraction  programming  language  used  for creating  efficient  abstractions  while  also  offering   hardware  access.
6.      C++  Supports  Four  Types  of  Memory  Management
Yep,  C++  supports  four  different  types  of  memory  management:  static  storage  duration objects,  thread  storage  duration  objects,  automatic  storage  duration  objects,   and  dynamic storage  duration  objects.
7.      C++   was  First  Standardized  in  1998
The  working  group  known  as  JTC1/SC22/WG21  first  standardized  C++  in  1998.  Since then,  it  has  been  standardized  three  other  times,  with  the  most  recent  being  in  2014 (C++14).  But  that’s   not  the  end  of  the  line  for  the  programming  language.  C++  is expected  to  be  standardized  again  in  2017,  although  an  exact  date  has  yet  to  be announced.

Thursday, 12 October 2017

What is computer and Characteristics of Computer? Detailed history of computer

Meaning   of   the   word   "Computer",
Computer   is   derived   from   a   Latin   word   “computer”   which   means   to  “ to   calculate ” , “to count”, “to sum up” or “to think together”.  So  ,  more   precisely   the   word   computer means   a  " device that performs computation".
Definitions of Computer :-
A   Computer   is   programmed   device   with  a   set   of   instructions   to  perform  specific   tasks and  generate  results   at  a   very  high    speed.
A   computer   is   an  electronic  device   that   manipulates   information ,  or   data .  It   has   the ability   to   store ,  retrieve ,  and   process   data .
Computer   is   a   machine   that  manipulates   data   according   to   a   list   of    instructions.

Principles characteristic of computer:
   It   responds   to   a   specific  set   of   instructions   in  a  well  defined   manner.
 • It   can   execute   a   pre - recorded   list   of   instructions.
 • It   can   quickly   store   and    retrieve   large   amounts   of   data.
The   first   use   of   the    word   "computer"   was   recorded   in   1613  ,  referring   to   a   person who   carried   out   calculations  ,  or   computations ,  and   the   word   continued   to   be   used   in that   sense   until  the   middle   of   the   20th  century.
The   computer   as   we   know   it   today   had   its  beginning   with   a   19th  century   English mathematics   professor   name  Charles   Babbage.
He   designed  the   Analytical    Engine   and    it   was   this   design   that  the   basic  framework  of the   computers   of   today   are  based   on.

ENIAC 1946
Stands   for   Electronic   Numerical  Integrator  and   Calculator ,In  world  war  2 ,  the   ENIAC was  created   to   help   with  the  war  effort  against  German   forces.
The  ENIAC  was  the   first  electronic  computer   used  for  general   purposes ,  such  as  solving numerical   problems . It   was  invented  by  J.Presper Eckert and  John  Mauchly at the University of  Pennsylvania   in  an  effort   to   calculate   artillery  firing   tables  for   the  United  States  Army's  Ballistic  Research   Laboratory.
The  ENIAC  occupied   about  1,800 square feet ,  used  17,468  vaccum tubes , 15,000  relays , used  a  teletype ,  weighed   almost  50 tons ,  uses   200  kilowatts   of   electricity ,  and   cost   about   $500,000.

SAGE, 1954
The  SAGE  name  stood  for  "Semi-Automatic Ground Environment." It  was  a  continental  air-defense   network  commissioned  by  the  U.S.  military ,  designed  to  coordinate  radar  stations and  direct  airplanes  to  intercept  incoming  planes . SAGE  consisted  of   23  direction centers  (concrete-hardened bunkers across the United States and one in Canada),  each  with  a  SAGE computer   that  could   track  as  many   as  400  airplanes. The  SAGE  system   was  designed   to detect   atomic  bomb  carrying   Soviet   bombers   and   guide  American  missiles  to   intercept   and   destroy   them.
The   total   weight   of  the   SAGE  was  over  250  tons .  It  contains  60000   vacuum   tubes, 1750000   diodes  and  13000  transistors. 

Completed  in   1960 ,  the  drum  based  NEAC  2203   was  one  of   the   earliest   Japanese transistorized   computers ,  and   was   used   for   business ,   scientific   and   engineering applications . The   system   included   a   CPU ,  console , paper  tape  reader   and  punch ,  printer and   magnetic   tape  units. It   was   sold   exclusively   in   Japan ,  but   could   process   alphabetic and   Japanese   kana   characters.  Only   about  thirty  NEACs   were   sold. The   last   one   was decommissioned   in   1979.
Memory Type:
3,300 Add/s
Memory Size:
27,643,000 Yen

IBM System/360, 1964

Part   of   a   family   of   interchangeable   computers ,  the   IBM   System/360   mainframe   was  the first   to   cover  a  complete   range   of   applications ,  from  small  to   large ,  from   commercial  to scientific .  Users   were  able  to  enlarge  or  shrink  their  setup  without   having  to  make headache  inducing   software  upgrades  as  well .  Higher end  System/360  models  had  roles  in NASA's   Apollo  missions  as  well  as  air  traffic  control  systems.

CDC 6600, 1964
For  a   time   the   fastest  machine  in   the  world ,  Control   Data   Corporation's   6600  machine was   designed   by   noted  computer   architect  Seymour   Cray. It   retained   its   speed   crown until   1969 ,  when   Cray  designed  his   next  supercomputer.
The   6600   had   400,000  transistors  and   more   than  100  miles  of   wiring . In  addition  to  a blazingly  fast  floating  point  processor ,  it   had   10  “peripheral processors”  that   did housekeeping   and   input / output   tasks   at   the   same   time.

DEC PDP-8, 1965
The   first   successful   commercial   minicomputer ,  the  PDP8 ,  made   by   the   Digital  Equipment   Corporation ,  sold   more   than   50,000   units  upon   its   release,  the   most  of  any computer   up   to   that   time . Years   before  Apple   and  Gnu/Linux   offered  alternatives  to   the dominant   IBM / Microsoft  paradigms ,  DEC  proposed  its  own  vision ,  by  encouraging  users  to  educate  themselves   and  take  part  in   the  evolution  of   the  line.
interface Message Processor, 1969
Conceived  at  the   height   of   the   Cold  War ,  when  the  U.S.  government  sought  a  way  to keep  its  network   of   computers   alive   in   case  certain  nodes  were  destroyed  in   a  nuclear attack   or   other   hostile   act ,  the   IMP  featured  the  first  generation  of  gateways ,  which  are today   known   as  routers .  As  such, IMP performed a critical task in the development of the ARPANET (Advanced Research Projects Agency Network), the world's first operational packet switching network, and the predecessor of the contemporary global Internet.
Kenbak-1, 1971
often   considered   the   world's   first  " personal  computer " the  Kenbak   was   touted   as  an  easy-to-use   educational  tool ,  but  it  failed  to  sell  more  than  several  dozen  units. Lacking  a microprocessor ,  it   had only  256  bytes  of  computing  power  and  its  only  output  was  a  series of  blinking  lights.

Cray-1, 1976
At   the  time  of  its  release ,  the  Cray-1 ,  above ,  was   the  fastest  computing  machine  at  the world .  Despite  its  price  tag  between  $5  and  $10  million   it   sold  well .  It  is  one  of  the many  machines   designed   by  Seymour  Cray ,  a   computer   architect  who  devoted  his  life  to the  creation  of  so called  supercomputers ,  machines  which  prioritized  processing  capacity  and speed  of  calculation.
IBM Personal Computer, 1981
Featuring  an  independent   keyboard ,  printer  and  monitor ,  the  slick ,  complete looking  package that  was  the  IBM  PC  helped  push  personal  computing  out  of  the   hobbyist's  garage  and  into the  corporate  and  consumer  mainstream .  Its  immense  commercial  success  made  it  the hallmark  of  personal  computing  for  many  years  and  led  other  manufacturers  to  produce similar  desktop  models.
Osborne 1 Portable Computer, 1981
The  first  commercial  portable  computer ,  the  Osborne  weighed  24  lbs .  and  cost  less  than  $2,000 .  It gained   popularity   because   of   its  low   price   and  the   extensive  software  library   that  came   with  it.
Hewlett-Packard 150, 1983
Representing   the   first   step  in  a   technology   widely  available   today ,  the  HP  150  was  the first  commercially   available  computer   with  touch   screen   technology .  The  9-inch  computer screen   was  surrounded by  infrared  transmitters  and   receivers   that   detected   the   position   of the   user's   finger.

Featured Posts

Differ between cohesion and coupling and explain their types.

 Q1: What are the six types of the interaction coupling? Give one example of good interaction coupling  and one example of bad interaction ...

Popular Posts