MCT609 Fundamentals of Programming Module Handbook Master of Science in Software Engineering & Database Technologies (MScSED)
Table of Contents 1 Module Details 2 1.1 Module Description 2 1.2 Prerequisites 2 1.3 Module 2 1.4 Required Text 3 1.5 Module Assignments 3 1.6 Module Grading 3 2 Module Outline 4 3 Module Syllabus 6 3.1 Workshop One (Introduction) 6 3.2 Workshop Two (Flow of Control I) 7 3.3 Workshop Three (Flow of Control II) 8 3.4 Workshop Four (Functions and Modular Programming) 9 3.5 Workshop Five (Data Arrays) 10 3.6 Workshop Six (Pointers and File Handling) 11 3.7 Workshop Seven (Characters, Strings and User-Defined Types) 12 3.8 Workshop Eight (Module Summary and Final Exam) 13 Document History Version Description Date of Last Date of Last Word File Excel File Update Update 1.0 [Clare] Original MCT612 Course Handbook 2004-2010 2.0 [Clare] Starting document for planned multimedia 23/7/2010 23/7/2010 revisions to MCT612. This document also reflects formatting changes and incorporates an Excel tool for the management of recurring information. 2.1 [Marie] Following revisions added: 20-Sep-10 20-Sep-10 Update header for version number 3.0 Updated section 1.4 for latest version of textbook Updated section 2 for to enter assessment details. Updated section 2 to move content on structs from week 8 back to week 7. 2.2 [Clare] Accepted all changes, fixed formatting of 26/9/2010 26/9/2010 textbook reference per NUIG guidelines. Edited table (slightly) in section 2 to fit all text in. Updated TOC. 2.3 [Marie] Updated section 2 so that entries listed in 06-Oct-2010 06-Oct-2010 column match Articulate topic/section names. Updated section 3.3 to tidy up workshop 3 objectives. 13-Oct-2010 13-Oct-2010 Updated section 3.4 to tidy up workshop 4 objectives. 07-Jan-2011 07-Jan-2011 Updated sections 3.4, 3.5, 3.6, 3.7, and 3.8 to tidy up 13-Jan-2011 13-Jan-2011 workshops 5, 6, 7, and 8 objectives. 2.4 Updated sections 2 and 3.4 to reflect changes in 10-May-2011 10-May-2011 workshop 8 topic names. Updated sections to reflect edits from module review 31-May-2011 31-May-2011 meeting 30-May-2011 Updated every instance of module name and number 1
1 Module Details 1.1 Module Description In MCT609, Fundamentals of Programming, students will receive a solid introduction to the art and science of computer programming. The emphasis is on the fundamentals of problem solving and program construction, with the high-level C language used as the vehicle for doing this. Upon successful completion, students will be capable of developing and maintaining useful software of reasonable size and complexity. The module is suitable for students with no previous experience of computer programming as well as those with moderate previous knowledge or knowledge of languages other than C. It will provide students with a solid foundation in the key concepts of functional programming, as well as an appreciation of object-oriented programming. The emphasis is on applied problem-solving skills as well as on the theoretical concepts underlying the programming activity. Although the module focuses specifically on the C language, students who have successfully completed it will typically find learning other high-level languages relatively easy, having learned the important skills and concepts of programming in this module. 1.2 Prerequisites None 1.3 Module At the end of the module, students are expected to be able to competently: Design and develop well-structured, modular, maintainable software programs using the C language Understand and modify C programs written by other people Design and develop C programs of substantial size, involving multiple source files and libraries imported from other programmers Design and develop C programs of substantial algorithmic complexity, involving multiple nested control structures and multiple dimensioned arrays Make competent use of pointers and dynamic memory allocation for flexible data storage Make use of data structures and understand their relevance to object-oriented programming Develop C programs that make use of disk files for persistent data storage Transfer the principles of programming using C to other high-level programming languages 2
1.4 Required Text Deitel, H.M, and Deitel, P.J. (2010) C How To Program International 6th Edition. Pearson Education International. ISBN 0-13-705966-3. Companion website: http://wps.pearsoned.com/ecs_deitel_chtp_6_int Code sample downloads: http://media.pearsoncmg.com/ph/esm/deitel/c_htp6e/code_examples_int.html 1.5 Module Assignments Details of module assignments and a sample final examination are detailed fully in the MCT609 Facilitator Guide. Student assessment will take the form of: Weekly programming assignments Participation in the weekly forum discussions A final exam consisting of program development tasks and theoretical questions 1.6 Module Grading Assessment Weight Workshop Forum participation 20% 1 to 8 Weekly assignments/labs 50% 1 to 7 Final exam 30% 8 Total 100% 3
2 Module Outline Workshop Assessments 1: Introduction Introduction to C The Visual C++ IDE Reading and Adding Numbers The if Statement Students are required to complete two programming exercises, involving data input/output and the if statement. 2: Flow of Control I 3: Flow of Control II 4: Functions and Modular Programming 5: Data Arrays Flow of Control Counter-Controlled Repetition Sentinel-Controlled Repetition The do...while Statement Nested Control Structures Looping with for Multiple-Selection with switch Logical Operators Functions in C Functions and Scope Time and Date Functions Random Numbers Recursion Arrays More about Arrays Sorting Arrays Students are required to complete two programming exercises, involving simple looping. Students are required to complete two programming exercises, involving non-nested and nested loops. Students are required to complete two programming exercises, involving functions and recursion. Students are required to complete two programming exercises, involving sorting and arrays. Searching Arrays 4
Workshop Assessments 6: Pointers and File Pointers Students are required to complete Handling two programming exercises, More about Pointers involving pointers and file handling. File Handling (Sequential Access) File Handling (Random Access) 7: Characters, Strings and User- Defined Types Characters and Strings More about Strings User-Defined Data Types Students are required to complete two programming exercises, involving string handling. Object-Oriented Programming 8: Module Summary and Final Exam Module Summary There is NO assignment this week, because students are required to complete the final exam. 5
3 Module Syllabus 3.1 Workshop One (Introduction) Describe the evolution of programming languages and the context of the C language within that evolution Define the roles of the editor, preprocessor, compiler and linker in the development process Identify the key components of a C program: comments, preprocessor directives, the main function, variable declarations, C commands Write C expressions involving mathematical operators and variables Write C selection statements using the if keyword and relational operators Use printf to output data to the screen Use scanf to input data from the keyboard Write simple C programs using variables, expressions, if statements, and input/output Use the Visual C++ IDE to create, compile and run simple C programs Introduction to C The Visual C++ IDE Reading and Adding Numbers The if Statement Suggested Activities Facilitator and students introduce themselves The facilitator explains course objectives, grading criteria, assignments and administrative matters The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 6
3.2 Workshop Two (Flow of Control I) Define the terms algorithm and pseudocode Define the term flow of control, and discuss the use of sequential execution, selection control structures, and repetition control structures Define the roles of the if statement header and body components Write C statements involving the use of if and if-else selection control structures Describe the role of the compound statement in C Describe the roles of the while statement header and body components Write C statements involving the use of while and do-while repetition control structures, both with and without compound statements Identify the differences between counter-controlled repetition and sentinel-controlled repetition, and identify which of these is appropriate for typical algorithmic problems Develop algorithms for problems requiring repetitive actions Write simple C programs involving variables, expressions, selection and repetitions control structures, and input/output Flow of Control Counter-Controlled Repetition Sentinel-Controlled Repetition The do...while Statement Suggested Activities The facilitator explains workshop objectives The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 7
3.3 Workshop Three (Flow of Control II) Identify programming problems where two or more nested control structures are required Develop C programs involving nested control structures Write C statements involving the use of for repetition control structures, both with and without compound statements Write C for loops involving simple incremental counter control and also more complex counter control Discuss the use of a for loop counter control variable as a way of producing a list of values required for iterative operations Distinguish between programming problems appropriately solved using while loops and those appropriately solved using for loops Identify the components of the switch multiple-selection statement Develop C programs using the switch statement Write C control structures involving multi-part logic combined using the logical operators Write simple C programs involving nested control structures, repetition, single and multiple-selection statements, and multi-part control logic Nested Control Structures Looping with for Multiple-Selection with switch Logical Operators The facilitator explains workshop objectives The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 8
3.4 Workshop Four (Functions and Modular Programming) Explain the role of functions in programming Write C functions that receive and process inputs, and return a calculated value Write C programs that make use of functions from the standard library Explain the terms call-by-reference and call-by-value Explain the terms scope, lifetime, and local variable Explain the terms random number, pseudo-random number, and simulation Use the pseudo-random number generator in C programs Define the term recursion Use recursive functions to solve simple problems Functions in C Functions and Scope Time and Date Functions Random Numbers Recursion Suggested Activities The facilitator explains workshop objectives The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 9
3.5 Workshop Five (Data Arrays) Define the terms array, subscript, and dimension Explain the difference between sequential-access data structures and random-access data structures Write C code that declares and initialises data arrays (both single- and multi-dimensional) Write C expressions and assignment statements involving subscripted arrays Write C functions that receive arrays as input parameters Explain the Bubble Sort algorithm Write C programs that use Bubble Sort to sort arrays of data Explain the Linear Search and Binary Search algorithms Write C programs that maintain ordered data arrays and search them using Binary Search Arrays More about Arrays Sorting Arrays Searching Arrays Suggested Activities The facilitator explains workshop objectives The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 10
3.6 Workshop Six (Pointers and File Handling) Explain the difference between a variable s address and its value Define the pointer reference and de-reference operators Write C code that declares and initialises pointer variables Discuss the uses of pointers in the C language Write C functions that receive and modify their arguments by reference Outline the differences between conventional arithmetic and pointer arithmetic Discuss the relationships between arrays and pointers Compare and contrast static memory allocation and dynamic memory allocation Write C code that uses the appropriate standard library functions to dynamically allocate and de-allocate blocks of memory Explain the difference between binary files and ASCII text files Explain the difference between sequential access files and random access files Define the term file position pointer Write C code that opens files from disk, reads and writes their contents, and closes them Pointers More about Pointers File Handling (Sequential Access) File Handling (Random Access) Suggested Activities The facilitator explains workshop objectives The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 11
3.7 Workshop Seven (Characters, Strings and User-Defined Types) Write C code that manipulates character data via the ASCII table Write C programs that use the character handling functions and macros from the standard library Define the term string and explain the storage of strings in the C language Explain the relationship between integers, characters, and strings in the C language Write C programs that use the character handling functions and macros from the standard library Write C programs that use the string handling functions from the standard library Explain the role of enumeration constants in the software development and maintenance process Define the term member variable Declare and initialise structs in C Design appropriate sets of structs for representing the data in computer applications of reasonable complexity Design sets of nested structs Write C code that manipulates structs directly using the dot operator and indirectly using the pointer operator Explain the basic concepts of Object-Oriented programming Discuss the role of structs in Object-Oriented programming Characters and Strings More about Strings User-Defined Data Types Object-Oriented Programming Suggested Activities The facilitator explains workshop objectives The facilitator leads a discussion of the reading material Students review the assigned learning materials (multimedia presentations, videos etc.) The facilitator leads a discussion of the weekly discussion topic(s) The facilitator reviews the workshop s research and assignment questions Students work on the workshop assessments 12
3.8 Workshop Eight (Module Summary and Final Exam) Present a body of work that show evidence of his/her ability to analyse programming problems of reasonable complexity and produce working, maintainable solutions in the C language Suggested Activities The facilitator leads a discussion of the module summary: review of content and student perceptions of achieved learning etc. The facilitator leads a discussion of exam requirements and procedures Students complete the final exam Students submit course evaluation and comment forms 13