DCU Home | Our Courses | Loop | Registry | Library | Search DCU

Module Specifications..

Current Academic Year 2023 - 2024

Please note that this information is subject to change.

Module Title C/C++ Programming for Engineers
Module Code EE219
School School of Electronic Engineering
Module Co-ordinatorSemester 1: Conor McArdle
Semester 2: Conor McArdle
Autumn: Conor McArdle
Module TeachersConor McArdle
NFQ level 8 Credit Rating 5
Pre-requisite None
Co-requisite None
Compatibles None
Incompatibles None
None
Resits are available for both the terminal examination and continuous assessment elements
Description

This module introduces students to the C and C++ programming languages and fundamental object-oriented design and programming principles. Students develop practical programming skills through a set of software design and implementation exercises. Students will also develop and demonstrate an understanding of how object-oriented principles enable appropriate code design and structure to extend existing C/C++ code, enabling them to integrate their own code with large-scale software systems and gain a fundamental understanding of software engineering principles. The module also reviews basic computer architectures and computer language fundamentals, so that students understand the connection between programming and the common underlying digital hardware / computational machinery.

Learning Outcomes

1. Describe and explain the basic operation of computer hardware and differentiate between types of programming language and execution model
2. Demonstrate an understanding of the fundamentals of the C/C++ programming languages and object-oriented design
3. Implement code in C that demonstrates an understanding of the underlying computational machine, including its limitations
4. Implement solutions to problems in C and C++ with an emphasis on practical engineering problem-solving
5. Design and implement C++ code that requires extension of existing code, demonstrating an understanding of object-oriented programming principles and software design
6. Design and implement C++ programs that graphically illustrate/animate the operation of the student's solutions to given problems



Workload Full-time hours per semester
Type Hours Description
Lecture24Lecture attendance
Assignment Completion30C/C++ programming exercises
Independent Study71Revision of learning materials
Total Workload: 125

All module information is indicative and subject to change. For further information,students are advised to refer to the University's Marks and Standards and Programme Specific Regulations at: http://www.dcu.ie/registry/examinations/index.shtml

Indicative Content and Learning Activities

Introduction and Context
Overview of computer hardware/architecture. Computer language levels. Translation schemes and execution models: compilers versus interpreters. Abstraction in programming: imperative vs declarative languages, procedural vs object-oriented programming languages.

Fundamentals of C
Structure of a C programme. Overview of C language syntax. Primitive data types. Variables, declaration, initialization and assignment. Constants and literals. Machine-level representation of integral and floating-point types. Type conversion and casting. Operators: arithmetic, logical, relational, and bit-wise operators. Operator precedence and expression evaluation order.

Flow Control
if-else statements, switch statements, while loops, do-while loops, for loops, break and continue statements. Nested loops. Simple numerical processing algorithms.

Functions
Function call and return semantics. Local variables and scope. Pointers to functions in C. Recursive functions. Function call stack overhead.

Pointers, Arrays and Strings in C
Arrays and Pointers. Pointer arithmetic. The C string library. Simple string processing algorithms. Function pointer parameters (C pass-by-reference). Relation/differences between arrays and pointers.

Elementary data Structures in C
structs, enums, nested structures, multi-dimensional arrays. Passing structures to and from functions. C programme design as data structures plus functions.

Source Code Translation
Header and source files, pre-processor directives, header guards, extern declarations, forward declarations, standard and user-defined C libraries, compilation and linking processes, using an IDE to manage source files. Structuring large C programmes as user-defined libraries.

Introduction to C++
Relationship between C and C++. Some simple C++ examples. C++ header files, namespaces, cout and cin from the standard C++ library. Basic C language features in use in C++ programmes: variables, loops, and simple functions.

Introduction to OOP Concepts
Introduction to Object-Oriented Programming and Design. Limitations of user-defined data types (structs) in C. Objects in OOP: variables with data plus behaviour. Classes: user-defined types tailored to the problem being solved. Class Diagrams: Composition relationship. Inheritance between classes. Overriding methods. Abstract methods and abstract classes. Polymorphism. C++ a “better” C language: comparison of handling strings in C and C++. Review of general principles towards good OOP design.

Some New C++ Features
Namespaces in C++. Overloaded functions. Overloaded Operators. References in C++. Passing references to functions. Reference to const as function parameter. "Pass-by-Value" and "Pass-by-Reference" and passing pointers (C-style pass-by-reference). Returning references from functions. Dynamic memory allocation in C++: new and delete operators.

Introduction to Classes in C++
General class declaration/definition syntax. Creating and using a class. Public and private class members. Constructors: the default/parameterless constructor, constructors with parameters, multiple/overloaded constructors, member initialization lists. Passing objects to functions and returning objects from functions. Copy constructors: Copy initialization versus copy assignment. Deep copying an object. Memory management/protective copying. Lifetime/lifecycle of objects. Class destructors.

More C++
Arrays of objects and arrays of pointers to objects. Static class members. Static variables and static methods. The "this" pointer: returning a reference to this object from a class method. Returning reference to const, and const member methods. Summary of the use of the const keyword in different contexts. Anonymous and temporary objects. Writing classes as separate declarations and definitions.

Composition Relationship between Classes in C++
Composition relationship between classes. Lifecycles of objects and member initialization. Composition in OOP design with examples. Requirements for a well-designed library interface (API).

Inheritance between Classes in C++
Uses and advantages of inheritance in OOP. Syntax for inheritance between classes - derivation access specifiers. Protected base class members. References and pointers of base class type - polymorphic types. Virtual methods and method overriding. Child class calling base class methods. Virtual methods and run-time polymorphism. Inheritance of interface vs inheritance of implementation. Abstract base classes - pure virtual methods. Interface inheritance vs implementation inheritance. Note on object slicing. Subclass Constructors. Order of construction and destruction in class hierarchy. Virtual destructors. Cloning in lieu of virtual constructors.

Assessment Breakdown
Continuous Assessment25% Examination Weight75%
Course Work Breakdown
TypeDescription% of totalAssessment Date
AssignmentFive homework assignments, each worth 5%. Due in weeks 3, 5, 8, 10, 12.25%Every Second Week
Reassessment Requirement Type
Resit arrangements are explained by the following categories;
1 = A resit is available for all components of the module
2 = No resit is available for 100% continuous assessment module
3 = No resit is available for the continuous assessment component
This module is category 1
Indicative Reading List

  • Conor McArdle: 2023, EE219 Course Notes and Code Examples, DCU, DCU,
  • Brian W. Kernighan, Dennis M. Ritchie: 1988, The C Programming Language, 2, Prentice Hall Professional Technical Reference,
  • Paul Deitel, Harvey Deitel.: 2011, C++ how to program, 6, Pearson Education, 0273752766
Other Resources

None
Programme or List of Programmes
ECEBEng Electronic & Computer Engineering
ECSAStudy Abroad (Engineering & Computing)
ECSAOStudy Abroad (Engineering & Computing)
Date of Last Revision10-AUG-05
Archives:

My DCU | Loop | Disclaimer | Privacy Statement