Q1-Chapter Review
Q1-Chapter Review
Software Categories:
• System Software
• Programs written for computer systems
• Application Software
• Programs written for computer users
Terminologies
Computer Languages:
• Machine Language
• Uses binary code, Machine-dependent, Not portable
• Assembly Language
• Uses mnemonics, Machine-dependent, Not usually portable
• High-Level Language
• Uses English-like language, Machine independent, Portable
Terminologies
Syntax
• is the set of rules that defines the combinations of symbols
that are considered to be correctly structured statements or
expressions in that language.
Semantics
• is the field concerned with the rigorous mathematical study of
the meaning of programming languages.
Data Types
• Integer
• Character
• Boolean
• Floating Point
• Double Floating Point
• Valueless or Void
• Wide Character
Primitive Data Types
• Integer:
• Keyword used for integer data types is int. Integers typically requires 4 bytes of memory space
and ranges from -2147483648 to 2147483647.
• Character:
• Character data type is used for storing characters. Keyword used for character data type is char.
Characters typically requires 1 byte of memory space and ranges from -128 to 127 or 0 to 255.
• Boolean:
• Boolean data type is used for storing boolean or logical values. A boolean variable can store
either true or false. Keyword used for boolean data type is bool.
• Floating Point:
• Floating Point data type is used for storing single precision floating point values or decimal
values. Keyword used for floating point data type is float. Float variables typically requires 4 byte
of memory space.
Primitive Data Types
• Double Floating Point: Double Floating Point data type is used for
storing double precision floating point values or decimal values.
Keyword used for double floating point data type is double. Double
variables typically requires 8 byte of memory space.
• void: Void means without any value. void datatype represents a
valueless entity. Void data type is used for those function which
does not returns a value.
• Wide Character: Wide character data type is also a character data
type but this data type has size greater than the normal 8-bit
datatype. Represented by wchar_t. It is generally 2 or 4 bytes long.
Derived Data Types
Function
• A function is a block of code or program-segment that is
defined to perform a specific well-defined task.
Array
• An array is a collection of items stored at continuous
memory locations. The idea of array is to represent many
instances in one variable.
Derived Data Types
Pointers
• Pointers are symbolic representation of addresses.
Reference
• When a variable is declared as reference, it becomes an
alternative name for an existing variable
Abstract or User-Defined Data Types
Class
• It is a user-defined data type, which holds its own data members
and member functions, which can be accessed and used by creating
an instance of that class. A class is like a blueprint for an object.
Structure
• A structure is a user defined data type in C/C++. A structure creates
a data type that can be used to group items of possibly different
types into a single type.
Abstract or User-Defined Data Types
Union
• Like Structures, union is a user defined data type. That all
members share the same memory location.
Enumeration
• It is mainly used to assign names to integral constants, the
names make a program easy to read and maintain.
Typedef
• Using typedef does not actually create a new data class, rather
it defines a name for an existing type.
Header Files
• #include<stdio.h>
• It is used to perform input and output operations using
functions scanf() and printf().
• #include<iostream>
• It is used as a stream of Input and Output using cin and
cout.
• #include<string.h>
• It is used to perform various functionalities related to string
manipulation like strlen(), strcmp(), strcpy(), size(), etc.
Standard Header Files And Their Uses
• #include<math.h>
• It is used to perform mathematical operations like sqrt(), log2(),
pow(), etc.
• #include<time.h>
• It is used to perform functions related to date() and time() like
setdate() and getdate(). It is also used to modify the system date
and get the CPU time respectively.
• #include<float.h>
• It contains a set of various platform-dependent constants related
to floating point values.