CSC 221
CSC 221
Global class: Is a place where the main function for the sub class is written .
Int main void is the part of the program that embodifies or Carries the local executable codes. It is
the place where the code to run is written.
There are two type of comments in all static OOP . Comment can be written at any portion of the
program, comment are not part of the program . It’s mainly for readers, direction or guides not a
program , may/ may not contain a comment and for the clarity of any reader of the code, it is good
to include comments.
Types of comments
1. Single line / expression comment : it is written using // .
2. Multiple lines / multiple expressions comment : This kind contain two or more expressions
but of expressions/*⸻⸺-*/
Print: it is used to display result of a executed code
Scanf : Scanf is used as users input code , the user can make changes in the code … Scanf (“”)
return 0 : return 0 is an instruction code in c language that after execution has been performed and
the code has success run, it instantly compiler to return the void value by telling the programmer tu
press any key to restart or continue.
It’s important that every written code in c must include the curly brace of the return 0;
Note : every expression in c language or others object oriented program ( the static type must end
in semi colon ) .
Example :
Int main void( ){
// writing my first programming
Int a;
Int b;
Int c;
a+b=c;
printf(“%d,c”,c);
return 0;
}
A character set is defined as any alphabet digit or symbols used in representing an information in a
programming language is called character set.
It’s also symbols called Identifiers.
Data type
There are 4 kinds of data type :
1. Basic built in data type eg float, Int , Boolean, character, double
2. Enumeration data type
3. Derived data type eg pointer , array structure
4. Void data type. eg void
5. Constant
Work done
Write a code to calculate the multiple of 3 numbers
Assignment
Write a program to calculate average of 3 numbers , if this numbers were float.
Assignment
Name the features of OOP .
Work
1. Write a program to show two numbers which is bigger
Assignments
⁃ Write a short note on the following small talk simula , C++, c language, Java , C# ,.net ,
VB. Net , Visual Basic , fortan and cobol
⁃ Write short note on two classes of OOP with examples .