Monday, November 14, 2011

1) Explain datatypes in c++. 2) Explain declaration & branching control statement in c++. 3) Explain object oriented methodology in c++.

1) A datatype in any programming language defines the type
of data a variable will hold in memory.  The basic datatypes in C++
are:


char --> character (such as "a" or b"), or a
small integer (-128<n<127 or 0<n<255)
int
--> integer (whole numbers)
bool --> boolean (i.e. true or
false)
float --> floating point number (can have decimal numbers up to
7 digits)
double --> double precision floating point number (can have
decimal numbers up to 15 digits)


2) Control statements in
programming control what pieces of code will be executed
when.


Branching control statement --> depending on
the condition, different code will be executed.  Examples of branching control
statements are if and switch statements


Declaration control
statement --> executes code while the conditions of the statement are being met,
these are typically loops: for, while etc.


3) Object
oriented program essentially models computer language as easy to decipher thinking. 
Unlike machine code which is like learning a new language entirely, in object oriented
programming it reads and flows like thought: if this, then do that, for this, do that,
etc.

No comments:

Post a Comment

How is Anne&#39;s goal of wanting &quot;to go on living even after my death&quot; fulfilled in Anne Frank: The Diary of a Young Girl?I didn&#39;t get how it was...

I think you are right! I don't believe that many of the Jews who were herded into the concentration camps actually understood the eno...