University of Macau Department of Electromechanical Engineering EMEB111 Program Design for Engineers Syllabus 1 st Semester 2012/2013 Part A Course Outline Compulsory course in Electromechanical Engineering Course description: This course introduces computer science with basic logic and fundamental programming techniques, and demonstrates how to improve procedural solutions by the object-oriented programming (OOP) approach as well. Fundamental of programming includes primitive data types, expressions, control statements, functions and arrays, which prepare students to learn object-oriented programming. Both theoretical concepts and practical skills are involved; students can experience problem solving by formulating programmatic solutions for real problems and translate them into programs with the programming language C/C++. Prerequisite: None Textbook: Y. Daniel Liang, Introduction to Programming with C++, Second edition, Pearson Higher Education, 2010. Reference: Barbara Johnston, C++ Programming Today, Second edition, Pearson Prentice Hall, 2008. Joel Adams & Larry Nyhoff, C++: An Introduction to Computing, Third edition, Prentice Hall, 2003. http://www.cs.ust.hk/~dekai/library/eckel_bruce/ http://msdn.microsoft.com/en-us/library/aa733747 http://www.cplusplus.com/doc/tutorial/ Course objectives: To provide an opportunity to students to: 1. learn the fundamentals of computers, programs, C++, software design principles and problem solving skills. [a, j] 2. understand the basic elementary of C++ programming, such as expressions, assignments, control and iterative statements. [a, c, l] 3. learn more advanced C++ programming techniques, including building functions, creating arrays and working with files. [a, c, j, l] 4. study the fundamentals of object-oriented programming, like using libraries, defining classes and invoking methods. [a, c, j, l] 5. apply learned C++ programming techniques to write computer programs solving specific problems. [a, c, e, j, l] Topics covered: 1. Introduction to computers, programs, and C++ computer basics, programs, fundamental of C++, software development cycle and starting out with C++. 2. Elementary programming data types and declarations, variables, expressions and operations, assignments, programming style and debugging. 3. Control statements selections, loops, using logical and conditional operators, nested loops and formatting output. 4. Function basics and advanced features parameters of functions, function prototypes, calling a function, inline functions, overloading functions, and reuse of functions by different programs. 5. Arrays array declaration and initialization, array operations, develop and invoke functions with array arguments, and process string using C-strings. 6. Objects and classes class structure and design, defining classes for objects, data field encapsulation, constructors, instance and static members of class, and passing objects to functions. 1
7. Files and streams use file streams to carry out I/O, standard input and output with files, processing data involving files, file streams as parameters. Class schedule and credits: Timetabled work in hours per week Lecture Tutorial Practice No of teaching weeks Total hours Total credits No / Duration of exam papers 2 0.5 1.5 14 56 3 1 / 3hrs Topic outline: Week No. No. of hours Topics 1 2 Introduction to computers, programs, and C++ Review computer basics and programs; realize the fundamental of C++; understand software development cycle; and develop a simple C++ program for console output using Visual C++. 2-3 3 Elementary programming Study basic data types, their declarations and initializations; use variables to store data; read input from keyboard; program with assignment statements and expressions; familiar with C++ documentation, programming style; and experience various errors and debug logic errors. 3-4 2.5 Selections Implement selection control using if and switch statements; combine conditions using logical operators; write expressions using the conditional operator; format output using stream manipulators; and examine the rules governing operator precedence and operator associativity. 4-5 2.5 Loops Write loops using do-while, while and for statements; control a loop with the user confirmation or a sentinel value; write nested loops; learn the techniques for minimizing numerical errors; and implement program control with break and continue. 6 2 Function basics Define and invoke different types of functions; use function prototypes for function headers; know how to pass arguments; create header files for reusing functions; develop functions for various tasks; and develop applications using C++ functions. 7 2 Midterm Exam 8-9 3 Advanced function features Experience advanced topics on pass-by-value, pass-by-reference; understand the difference between them; determine the scope of local and global variables; define functions with default arguments; and improve runtime efficiency by using inline functions. 9-10 3 Arrays Understand the necessity of an array in programming; know how to declare and initialize an array; program common array operations; develop and invoke functions with array arguments; and process string using C-strings. 11-12 4 Objects and classes Describe objects and classes; create objects using constructors; distinguish between instance and static variables and functions; access data fields and invoke functions using the object member access operator; and declare private data fields for data field encapsulation and make classes easy to maintain. 13 2 Files and streams 2
Learn ifstream, ofstream, and fstream classes for processing and manipulating files; read and write data using the getline, get and put functions; study functions to test file existence and the end of a file; and open a file for both input and output to update files. 14 2 Final Review Contribution of course to meet the professional component: This course teaches students with no prior experience in computing to understand ideas at the core of computer science and solve simple problems with programming language. Relationship to EME program objectives and outcomes: This course primarily contributes to electromechanical engineering program outcomes that develop student abilities to: (a) An ability to apply knowledge of mathematics, science, and engineering; (c) An ability to design a system, component, or process to meet desired needs within realistic constraints, such as economic, environmental, social, political, ethical, health and safety, manufacturability and sustainability. (j) A knowledge of contemporary issues. (l) An ability to use the computer/it tools relevant to the discipline along with an understanding of their processes and limitations. The course secondarily contributes to electromechanical engineering program outcomes that develop student abilities to: (e) An ability to identify, formulate, and solve engineering problems; Course content: Maths Basic Science Engineering Science Engineering Design and Synthesis Complementary Studies Computer Studies Total 100% 0 0 30% 20% 0 50% 100% Persons who prepared this description: Dr. Sam Chao 3
1 st Semester 2012/2013 Part B General Course Information and Policies Instructor: Dr. Sam Chao Office: R108 Office Hour: Mon 3:00 pm 5:00 pm, Tue 4:30pm6:30pm, Phone: 8397 8051 Wed 9:30 am 11:30am, or by appointment Email: lidiasc@umac.mo Time/Venue: Lecture: Every Tuesday, 2:00 p.m. - 4:00 p.m., Room HG02 Laboratory: Every Monday, 2:30 p.m. - 4:30 p.m., Room NG03 Every Saturday, 10:30 a.m. - 12:30 a.m., Room NG02 Assessment: Final assessment will be determined on the basis of: In-class exercises 5% Lab practice 5% Homework: 10% Lab Quiz: 20% Mid-term exam (closed book): 25% Final Exam (3-hour closed book exam): 35% Grading System: The credit is earned by the achievement of a grade from A to D ; F carries zero credit. Grades are awarded according to the following system: Letter Grades Grade Points Percentage A 4.0 (Excellent) 93-100 A- 3.7 (Very good) 88-92 B+ 3.3 83-87 B 3.0 (Good) 78-82 B- 2.7 73-77 C+ 2.3 68-72 C 2.0 (Average) 63-67 C- 1.7 58-62 D+ 1.3 53-57 D 1.0 (Pass) 50-52 F 0 (Fail) Below 50 Homework Policy: The completion and correction of homework is a powerful learning experience; therefore: There will be approximately 6 homework assignments, lab exercises and occasional in-class assignments. Homework is due one week after assignment unless otherwise noted, no late homework is accepted. The course grade will be based on the average of the HW grades. Quizzes and exams One 2-hour mid-term exam, one 3-hour final exam and approximately 3 Lab quizzes will be held during the semester. All the quizzes and exams are closed book tests. Note Attendance is strongly recommended. No make-up exam is given except for CLEAR medical proof. Cheating is absolutely prohibited by the university. 4
Appendix - Rubric for Program Outcomes Rubric for (a) 5 (Excellent) 3 (Average) 1 (Poor) Understand the theoretic background Compute the problem correctly Students understand theoretic background and the limitations of the respective applications. Students use correct techniques, analyze the problems, and compute them correctly Students have some confusion on some background or do not understand theoretic background completely Students sometime solve problem mistakenly using wrong techniques Students do not understand the background or do not study at all Students do not know how to solve problems or use wrong techniques completely Rubric for (c) 5 (Excellent) 3 (Average) 1 (Poor) Design capability and design constraints Process to meet desired needs Student understands very clearly what needs to be designed and the realistic design constraints such as economic, environmental, social, political, ethical, health and safety, manufacturability, and sustainability. Student understands very clearly the process of the design Student understands what needs to be designed and the design constraints, but may not fully understand the limitations of the design constraints Student understands what the needs of the process design, but may not fully understand the limitations of the design constraints Student does not understand what needs to be designed and the design constraints. Student does not understand the process. Rubric for (e) 5 (Excellent) 3 (Average) 1 (Poor) Identify applications in engineering systems Modeling, problem formulation and problem solving Students understand problem and can identify fundamental formulation Students choose and properly apply the correct techniques Students understand problem but cannot apply formulation, or cannot understand problem Students model correctly but cannot select proper technique, or model incorrectly but solve correctly accordingly Students cannot identify correct terms for engineering applications Students at loss as to how to solve a problem Rubric for (j) 5 (Excellent) 3 (Average) 1 (Poor) Relevance to the Present Time Student displays an understanding of the theoretical or practical impact and an ability to correlate a subject, perception, communication, association and reasoning from a global and societal perspective. Student is able to display an understanding of current topics and issues with some knowledge regarding their impact in a bigger global and societal sense. Student has difficulty demonstrating an awareness or familiarity with current topics and issues relevant to most current global and societal affairs. 5
Rubric for (l) 5 (Excellent) 3 (Average) 1 (Poor) Use computer/i.t. tools relevant to the discipline Student uses computer/i.t. tools relevant to the engineering discipline, and understands their limitations. Student uses computer /I.T. tools relevant to the engineering discipline. Student does not use computer/i.t. tools relevantly, and does not understand their limitations. 6