Add
Sunday, March 1, 2020
Sunday, November 18, 2018
Different Types
Different Types
The many different types of information systems can be divided into categories based on where they are used in the hierarchy of an organization.
What is an Information System?
What is an Information System?
Many organizations work with large amounts of data. Data are basic values or facts and are organized in a database. Many people think of data as synonymous with information; however, information actually consists of data that has been organized to help answers questions and to solve problems. An information system is defined as the software that helps organize and analyze data. So, the purpose of an information system is to turn raw data into useful information that can be used for decision making in an organization.
Typical Components of Information Systems
While information systems may differ in how they are used within an organization, they typically contain the following components:
- Hardware: Computer-based information systems use computer hardware, such as processors, monitors, keyboard and printers.
- Software: These are the programs used to organize, process and analyze data.
- Databases: Information systems work with data, organized into tables and files.
- Network: Different elements need to be connected to each other, especially if many different people in an organization use the same information system.
- Procedures: These describe how specific data are processed and analyzed in order to get the answers for which the information system is designed.
The first four components are part of the general information technology (IT) of an organization. Procedures, the fifth component, are very specific to the information needed to answer a specific question.
Friday, November 16, 2018
Structure of C program and Why we put braces () with main
Structure
of C program
•A
C program consist of following parts.
•1-
preprocessor Directive (#include<iostream.h>)
•2-main
function
void main ()
•{
• program body
• }
Why
we put braces () with main
•Braces tells the
compiler that the word “main” is name for a function. Otherwise compiler will
consider it is name of some variable or identifier.
•If braces are empty
it means function do not take input from some other function
•Like void main()
•If braces are not
empty then it means function may take input arguments.
•Like void main(int a , char b ) means
this funciton can take two input
arguments.
Example program and Rules for writing a program
Example
program
•#include<stdio.h>
•#include<conio.h>
•void
main()
•{
• printf”Hellow world";
•getch();
•}
•
Rules
for writing a program
•All the names of the
variables and other words should be in lower case
•The first function of
the program should be main.
•All the program
should be in medium braces {}
•After each
instruction of the program we should put semicolon but no semi colon after
main, preprocessor directive and braces because they are a part of program but
not executed like other instructions.
Comments in a program and Data types
Comments
in a program
•Comments are the
lines of the program which are ignored during the program execution.
•When a programmer
write a program he adds some comments with it to make the program easy to
understand.
•Comments may be
single line or multiple line.
•Single line comments
are proceeded by //
•Multiple line
comments should be within this symbol.
•/* coments */
Data
types
•Any
type of data that is used in c/c++ program has its type with the help of which compiler
can recognize it and can reserve space for it in memory.
•Basically
two types of data is used in c/c++
•Variable
and constant
Data types used in c program and int
Data
types used in c program
1- integer variable Int
2- character variable
Char
3- floating point variables
Float
4- Enumerator
Enum
5- class
Class
6- string
Char []
int
•This data type is
used to save integer values
•E.g. 2, 25 ,567 etc.
•C++ compiler use 4
bytes to save int
•In old compilers int was of 2 bytes so
its range was -32767 – 32768
•It comes in three
values, int, short int, long int
•Length of data
depends on compiler, but short int is at least 2 bytes and long int is at least 4 bytes
char and float
char
•It
is used to save single character
•Like
a x b c t / [ ] = etc
•Character
that is assigned should be enclosed in
inverted single commas like
‘ ’.
float
•Float
is used to store fractional values.
•Its
size depend on compiler .
•Usually
it is 2 byte.
•Fractional
part may be small or long. so we use
float(small factional size), double (medium fractional size) and long
double (long fractional size) for it.
Enumerator and class
Enumerator
•It
is used for user defined data type.
•For
example:
•Enum weekday {sun, mon, tues, wed, thurs, fri, sat};
•Weekday
currentday=wed;
•By
default value of enumerator starts from 0
•But
we can assign our own values as well.
class
•This
is another user defined data type used for sophisticated data.
•How
to write
•Class
class_name{
•Private_data;
•Public_data;
•}object;
string and constants
string
•String
is combination of characters.
•Syntax:
•Char
string_name[]= “value”;
constants
•Constants
are values which cannot be changed in the program.
•For
example we know that value of pi is 3.14 always.
•So
whenever we define pi, we define it as constant so that nobody can change its
value even by mistake.
How to declare constants
How
to declare constants
•There
are two ways to declare a constant value
•1-
write the word constant before the name of datatype e.g. const int x or const float pi
•2-
declare it before main() function.
•E.g . #define pi = 3.14
VARIABLES
variables
•These
are values which can change there value during program.
•It
can be int, float, char etc.
depending on our need.
•if
value of variable is changed, its new value is saved and previous value is
removed from memory.
BASIC DIFFERENCE BETWEEN C & C++
Basic
difference between c & c++
•Standard
I/O library used is stdio.h
•It
do not use namespace
•For
input we use scanf
•For
output we use printf
•It
supports object oriented programing
•Standard
I/O library used is iostream
•We
have to use namespace
•We
use cin>>
•We
use cout<< for output
•It
do not support object oriented programing
Subscribe to:
Posts (Atom)

