Document1 Page 1 COS120 Software Development Using C++ AUBG, COS dept, Academic Year 2014/15, Fall 2014 Assoc. Prof. Stoyan Bonev, PhD Syllabus Course Objectives: This course is intended as the entry point to the COmputer Science /COS/ major program and, as such, provides an introduction to the fundamental principles of imperative programming based on C++ as an implementation language, as well as emphasizing the basic skills of efficient software development following the Input-Process-Output /IPO/ model of a computing process and traditional concept for software development life cycle. The major topics covered include: Computer structure; Algorithms – definition, classification, notation; Structured Programming (Structured Systems Analysis & Design); Introduction to Object Oriented Programming /OOP/. Extensive exercises are used to illustrate syntax and semantics of all the programming constructs available in C++ – simple data types, operators, expressions, statements, functions and programs. COS120 serves a prelude to COS220, COS221 and COS240 courses where more advanced programming concepts are introduced. No prerequisites. Course Goals and Student Learning Outcomes: The COS120 course is the basic required introductory course to the Computer Science major program. The syllabus and course contents follow the goals of the program. By the end of semester student learning outcomes are as follows: Students will acquire basic principles of Software Life Cycle. Students will know to use integrated environments for developing C++ programs; Students will learn to create user defined functions for solving problems using simple data types, structures, pointers and programming techniques such as decision making, looping, string manipulation, and arrays processing. Students will know principles of structured programming and object oriented programming as basic methodologies for software development. Students will be able to develop software products using C++ as implementation language. Students will get background knowledge that permit to apply self study approach in learning IT topics aside the curriculum. Course Description: The COS120 Software Development Using C++ course includes lectures, exercises, quizzes and home works. Lectures present basic topics of computers, algorithms and programming in C++. Standard C++ (incl. ANSI C) is presented: program structure; data – numeric and symbolic literals, named constants and variables; data – fundamental types and abstract Document1 Page 2 types; expressions as composed of operands and operators; statements; functions – prototype, call, definition, parameter passing mechanisms; standard Input/Output and file Input/Output. Source texts of various programs oriented to concrete problem solving illustrate the topics covered. Exercises contain discussion on source texts of demo programs and tasks to be individually solved (designed as an algorithm and implemented to an executable program) by the student. Quizzes are short 15-30 min sessions and intend to train students’ skills in understanding specific C++ syntax constructs. Homework assignments are given at the end of a lecture. They are to be delivered to the lecturer with printed listing and output before fixed deadline. Sessions to demonstrate running home works take place in week 10 and week 14. Detailed Course Description: List of Lectures Lecture Lecture 1 Lecture 2 Lecture 3 Lecture 4 Lecture 5 Lecture 6 Lecture 7 Lecture 8 Basic Topic Introduction to Computers, Problem Solving and Programming. Computer hardware. Computer software. The software development method. Algorithms – definition and classification. Flowcharts as a tool for algorithm description. Computers, Problem Solving and Programming (continued). Applying the software development method. Introduction to linear algorithms and branch algorithms. Typical examples. Computers, Problem Solving and Programming (continued). Applying the software development method. Exercises on linear and branch algorithms. Introduction to loop algorithms. Typical examples. Computer Languages. Processing a C++ program (edit, compile, link and run). The C++ programming language – a tutorial introduction. Computer Languages. (continued). Programming Environments. Integrated Development Environments MS Visual Studio, Code Blocks. The project/solution concept. Console applications. Sample C++ programs. Computer Languages (continued). The C++ programming language elements. Structure of a C++ program. Top-Down Design with Functions. Step-wise refinement and structure charts. Functions topics: prototype, call and definition. Functions without arguments. Top-Down Design with Functions (continued). Functions with an input argument. The return statement. Functions returning a single result. Mathematical built-in library functions. Document1 Lecture 9 Lecture 10 Lecture 11 Lecture 12 Lecture 13 Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 21 Lecture 22 Lecture 23 Lecture 25 Lecture 26 Page 3 Functions and Program Structure. Basics of functions. System predefined and user defined functions. General form of a function definition. The minimal C++ function. Functions with multiple arguments. Control Flow. Selection (decision) structures. The if, if-else control statements. Nested if statements. Demo programs illustrations. Control Flow. Selection (decision) structures (continued). Conditions – expressions including arithmetic, relational, equality and logical operators. The switch control statement. Control Flow. Repetition (loop) structures. The while, for and do … while control statements. Control Flow. Repetition (loop) structures (continued). Logical and functional classification of loop (iterative) algorithms. Control Flow. (continued). The break, continue, goto statements. Nested loops. Design and implementation of programs using linear, branch and loop algorithms. Control Flow. (continued). Nested do-loops. Design and implementation of programs. Modular Programming. Functions with simple output parameters. Formal output parameters as actual arguments. Modular Programming (continued). Debugging and errors: syntax, run-time, undetected and logic errors; A program with multiple functions. Home works presentation. Functions and Recursion. The nature of recursion. Recursive mathematical functions. Program implementation of the Hanoi towers game. Simple Data Types. Representation and conversion of numeric types. Representation and conversion of type char. Enumerated data types. Arrays. Declaring and referencing arrays. Array subscripts. Using for loops for sequential access. Arrays (continued). Searching in array: linear and binary search. Multidimensional arrays. Strings. Library functions. Assignment and substrings. Concatenation. Comparison. Pointers. Pointers and addresses. Pointers and function arguments. Pointers and arrays. Pointer arrays. Structures. Document1 Lecture 27 Lecture 28a Lecture 28b Lecture 28c Page 4 Basics of structures. Structure type definition (typedef statement). Structures and functions. Structures as input parameters and return values. Arrays of structures. Pointers to structures. File Input/Output Processing. Input/output files. Text mode files and binary mode files. File access. Standard input/output streams. From C to C++. C++ as a superset of C. Stream oriented Input/Output. Scope resolution operator. Reference data type. Overloaded functions. Default Arguments Functions. From C to C++. Classes and objects. Introduction to Object Oriented Programming /OOP/. Back from C++ to C. C as a subset of C++. List of C++ syntax constructs not supported in C. List of Quizzes Quiz 1 Quiz 3 Quiz 5 Algorithms & Elementary C++ Selections and Loops Pointers and Strings Quiz 2 Quiz 4 Quiz 6 Skills in C++ functions Arrays Structures and OOP Hwk 2 Hwk 4 Hwk 6 Skills in C++ functions Arrays/Recursive functions Structures and OOP List of Home Works Hwk 1 Hwk 3 Hwk 5 Elementary C++ Selections and Loops Pointers and Strings References /Recommended textbooks/: 1. Friedman F.L., Koffman E.B., Problem Solving, Abstraction and Design Using C++, Pearson, Addison-Wesley, 6e, 2010. 2. Y. Daniel Liang, Introduction to Programming with C++, Pearson IE, 3e, 2014. 3. Cay S. Horstmann, C++ for Everyone, John Wiley & Sons, 2e, 2012. 4. Kernighan B.W., Ritchie D.M., The C Programming Language, Prentice-Hall, Inc., Englewood Cliffs, N.J., 1988. References /Other useful books/: 1. Any book on C/C++ available in the AUBG library. Grading: Final exam: 30% Midterm exam: 18% Home works: 6x3% 18% Quizzes: 6x5% 30% Class attendance: 02% Participation/Activities: 02% Document1 Page 5 The students will get a score in the range 0-100 for each component. The total score (computed with the above coefficients) will be used to form the final grade: A–, A B–, B, C–, C, D, D+ (excellent) cover scores B+ (good) cover scores C+ (average) cover scores (poor) cover scores 90-100 80-90 70-80 60-70 90 - - - - - - - - - 95 80-82 83-86 70-72 73-76 60 - - - - - - - - - 66 96-100 87-90 77-80 67-70 Scores below 60 mean failure. + and – will be used for distinguishing the results in a given level. Activity in a class will be treated as a bonus. Borderline cases will be resolved based on the followings: - Student participation in class providing intelligent questions, informative comments, and constructive criticisms. - On-time submission of homework assignments and projects. - Quality of presentation of all submitted works. - Class attendance. Attendance: - Students are expected to attend all classes (lectures and exercises). An attendance register will be taken at each class. Students who miss three classes will be dropped from the course. Mobile phones ringing in class disturb the whole class. Please switch off your mobile phone before each class. - There will be no make-up exam/quizzes for any reason. If you arrive late to an exam/quiz, you may still take the exam/quiz in the remaining time as long as nobody has finished the exam/quiz yet. - Browsing Internet in class is not allowed except by special request on topic discussed in the lecture. Academic honesty: Students are expected to demonstrate an academic behavior in full capacity of this term. Week schedule: COS120a Class room: COS Lab MB120 Wed 10:45-12:00 Fri 09:00-10:15 Office Hours: See list on office door or by appointment Lecturer: Assoc. Prof. Stoyan Bonev, PhD Office: 243 Tel: (ext.): 419 e-mail: sbonev@aubg.bg Document1 Page 6 COS120 SW Development Using C++ Fall semester 2014 (plan) Course Outline – Sequence of Classes Remark: This syllabus is subject to modification. The instructor will communicate with students on any changes such as in the schedule or the assignments. Week No 1 Wednesday 10:45–12:00 Friday 09:00–10:15 Lec1 Lec2 Intro Alg1 2 Lec3 Lec4 Quiz1a Alg2 C++ 3 Quiz1b / Lec5 / Lec6 / Hw1 Lec7 IDE1 IDE2 Functions1 4 Lec8 Lec9 Hw2 Functions2 Functions3 5 Quiz2 / Lec10 Lec11 Decision1 Decision2 6 Lec12 Lec13 Hw3 Loops1 Loops2 7 Quiz3 / Lec14 Lec15 Ctrl Flow1 Ctrl Flow2 8 Lec16 Lec17 MidTerm Modular Programming Debugger Exam Break week Break week 9 Lec18 Hw4 Lec19 Recursive Functions Simple Data types 10 Lec21 Lec22 Quiz4 Arrays1 Arrays2 11 Lec25 Lec24 Pointers Hw5 Strings 12 Lec26a Quiz5 Lec26 TrainingPtrArrStrings Structures 13 Lec28a Hw6 Lec28b Quiz6 OOP1 OOP2 14 Lec27 Files Final Exam Preparation