0% found this document useful (0 votes)
55 views20 pages

IT1050-Object Oriented Concepts: Lecture-01 - Introduction To C++

This document provides an introduction to the IT1050 Object Oriented Concepts module. It outlines the learning outcomes which are to understand and apply basic OOP concepts, design solutions using classes and relationships, and implement solutions in C++. It also describes the delivery method, assessment criteria, and content which will include introductions to C++, OOP concepts, classes and objects, OOP design, and advanced OOP concepts. Examples are provided to illustrate C versus C++, comments, preprocessing directives, the main function, and output statements.

Uploaded by

kelly alexa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views20 pages

IT1050-Object Oriented Concepts: Lecture-01 - Introduction To C++

This document provides an introduction to the IT1050 Object Oriented Concepts module. It outlines the learning outcomes which are to understand and apply basic OOP concepts, design solutions using classes and relationships, and implement solutions in C++. It also describes the delivery method, assessment criteria, and content which will include introductions to C++, OOP concepts, classes and objects, OOP design, and advanced OOP concepts. Examples are provided to illustrate C versus C++, comments, preprocessing directives, the main function, and output statements.

Uploaded by

kelly alexa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

IT1050- Object Oriented Concepts

Lecture-01 – Introduction to C++

1
IT1050| Object Oriented Concepts | Introduction| Anjalie Gamage
Agenda
• Introduction to Module
• Recalling C
• C to C++

IT1050| Object Oriented Concepts | Introduction| Anjalie Gamage


Introduction to Module

3
IT1050| Object Oriented Concepts | Introduction| Anjalie Gamage
Learning Outcomes
• Understand and apply the basic concepts of Object
Oriented Programming
• Design solutions by identifying the classes and
relationships (Object Oriented Analysis and Design)
• Implement a solution to the given problem using the
C++ Language

4
IT1050| Object Oriented Concepts| Introduction|
Delivery
• Lectures
• 1 Hour per week
• Tutorial
• 1 Hour per week
• Labs
• 2 Hours per week

5
IT1050| Object Oriented Concepts| Introduction|
Assessment Criteria
• Continuous Assessment

• Assignment 1 - Practical 10%


• Assignment 2 - Group work ( case study ) 10%
• Mid Term Examination 20%

• Final Examination 60%

6
IT1050| Object Oriented Concepts| Introduction|
Content
• Introduction to C++
• Introduction to OOP Concepts
• Abstraction
• Encapsulation
• Information Hiding
• Identifying classes and objects
• Object Oriented Design
• Noun Verb Analysis
• CRC Cards
• Introduction to Object Oriented Programming

• Advanced Object Oriented Concepts


• Relationships
• Polymorphism

7
IT1050| Object Oriented Concepts| Introduction|
Teaching Learning Activities
• Case Study - Library System
• Home work - Watching Videos
• Group work - Assignment 2

8
IT1050| Object Oriented Concepts| Introduction|
Academic Integrity Policy
• Are you aware that following are not accepted in SLIIT???
• Plagiarism - using work and ideas of other individuals intentionally or
unintentionally
• Collusion - preparing individual assignments together and submitting
similar work for assessment.
• Cheating - obtaining or giving assistance during the course of an
examination or assessment without approval
• Falsification – providing fabricated information or making use of such
materials
• From year 2018 the committing above offenses come with
serious consequences !
• See General support section of Courseweb for full information.
9
IT1050| Object Oriented Concepts| Introduction|
Reference

Deitel & Deitel’s (2016), Grady Brooch (2008), Object-


C++ How to Program, 9th Oriented Analysis and Design
Edition with Application,
3rd Edition 10
IT1050| Object Oriented Concepts| Introduction|
C++
• One of the most powerful and popular programming languages
• Evolve from C
• Developed by Bjarne Stroustrup in 1979 at Bell Laboratories
• Provide capabilities for Object Oriented Programming
• Current Version – C++ 17

11
IT1050| Object Oriented Concepts| Introduction|
C vs C++
// C Program // C++ Program
#include <iostream>
#include <stdio.h>
int main ( )
void main ( void) {
{ std::cout<< “Hello World !“ ;
std::cout<< std::endl;
printf (“Hello World ! \n”);
return 0;
} }

Output : Hello World !


12
IT1050| Object Oriented Concepts| Introduction|
First C++ Program
// C++ Program : prg_01.cpp
//Printing a String
#include <iostream> // allows program to output data to the screen

int main ( ) // Function main begins program execution


{
std::cout<< “Hello World !“; // Display message
std::cout<< std::endl; // New line

return 0; // indicate that program ended successfully

} // End of main function


13
IT1050| Object Oriented Concepts| Introduction|
Comments
// C++ Program : prg_01.cpp
//Printing a String

• Comments provide information to the people who read the program


• Comments are removed by the preprocessor, therefore the compiler
ignores them
• In C++, there are two types of comments
• Single line comments //
• Delimited comments /* */ for comments with more than one line.

14
IT1050| Object Oriented Concepts| Introduction|
Preprocessing Directives
#include <iostream>
• Lines begin with # are processed by the preprocessor before the program
is compiled.
• Notifies the preprocessor to include in the program the content of the
input/output stream header <iostream>
• “iostream” is a header file containing information used by the compiler
when compiling a program with output data to screen or input data from
the keyboard using c++ input/output stream

15
IT1050| Object Oriented Concepts| Introduction|
The main function
int main()
{

• C++ programs begin executing at function main.


• It is the main building block of a program.
• int indicates that main returns an integer value.
• { ( left brace ) indicates the begin of the main body and } ( right brace )
indicates the end of the function’s body.
16
IT1050| Object Oriented Concepts| Introduction|
Output Statement

std:: cout<< “Hello World ! “ ;


• cout : to indicate the computer to output
something on screen
• << : is the stream insertion operator used
to send information to cout
• “Hello World !” :String / String Literal. What you need
to display on screen
•; : statement terminator

17
IT1050| Object Oriented Concepts| Introduction|
New Line

std:: cout<< endl ;


• endl : to go to a new line ( same as “\n”)
eg : std::cout<<“\n”;

std:: cout<< “Hello World !”<< endl ;


Hello World !
Output : _
18
IT1050| Object Oriented Concepts| Introduction|
Exercise

•Write a C++ program to display your name


and address in 3 lines.

19
IT1050| Object Oriented Concepts| Introduction|
Reference

Chapter 01 & 02

Deitel & Deitel’s (2016), C++ How to Program,


9th Edition

20
IT1050| Object Oriented Concepts| Introduction|

You might also like