210 likes | 326 Vues
This course provides a comprehensive introduction to C++ programming, focusing on fundamental problem-solving techniques and algorithm design. Students will learn to write structured programs in C++, covering topics such as branching, looping, arrays, functions, recursion, and object-oriented programming (OOP). No prerequisites are required for COMP104, making it accessible for beginners. By the end of the course, students will be capable of creating simple applications, such as calculators, text editors, and games, equipping them for part-time programming opportunities.
E N D
Programming COMP104: Fundamentals and Methodology Introduction
Objectives • How to solve a problem (by computer) fundamental problem solving techniques • How to design an algorithm algorithm design • How to write a program in C++ implementation
Course description • Introduction • C++ basics for Structured (or procedural) Programming • Sequential (assignments) • Branching (if statement) • Looping (while-do statement) • Arrays and algorithms • Functions (local/global, value/ref), recursion • Files • Pointers and dynamic objects • Linked lists • Introduction to OOP (Object Oriented Programming) • Classes, objects • Abstract data types static mid-term dynamic
What can you do after this course? • Program the computer in applications such as the following: • Program a simple calculator • Program simple computer games • Program a simple text editor • Program a small inventory system for a small company • … • You will be ready to take on part-time programming jobs during Xmas break!
Course organization No any prerequisite for comp104! • Lectures (3 h) (office 3506, quan@cse.ust.hk) • Tutorials (1 h) • Not compulsary • Labs (2 h) • Compulsary! See lab policy. • Assignments (homework, 3 projects) But it’s a prerequisite for most of CS courses! Textbook: Programming in C++: Lessons and Applications, by Timothy B. D’Orazio
A typical weekly schedule • Tu Thur Lectures • Sat. Next lab posted on web • Mon-Fri Lab session (students encouraged to demo program by end of lab) • Sat. midnight Deadline for lab by CASS • Course webpage: course.cse.ust.hk/comp104/Password_Only • Print out ‘ppt’ with ‘handouts’ option!!! • Newsgroup, Facebook? • Eclipse tutorial • SVG tutorial
Grading Mark weighting • Labs (10%) • Assignments (25%) • Midterm exam (25%), 6th week, • 9th October, Sat. 1-3pm • Final exam (40%), Dec.
Introduction to Computer Systems • Hardware • Software
CPU - central processing unit • Makes decisions, performs computations, and delegates input/output requests • Memory: Stores information • Main memory: RAM, e.g. 256 MB RAM • Secondary memory: hard disk, e.g. 20GB • Input devices • Gets information from the user to the computer • Output devices • Sends information from computer to the user
Work Work Computer Worker Product Product Program Instructions What is a program? A computer program performs a specific task, and may interact with the user and the computer hardware. • Human work model: • Computer work model: A program is a set of instructions
What is a (programming) language? A sequence of instructions • A program needs to be written in a language • There are many programming languages • Low-level, understandable by a computer • High-level, needs a translator! • C++ is a high level programming language A program (in computer language) An algorthm (in human language)
An example: Machine binary language Low-level assembly High-level
Levels of programming language • Machine binary language: unintelligible • Low-level assembly language • Mnemonic names for machine operations • Explicit manipulation of memory addresses • Machine-dependent • High-level language • Readable • Machine-independent
How to translate? A program written in high-level programming language (for example, C++ program) Examples of compilers: • Microsoft Visual C++, Eclipse, g++ COMPILER (for example, Visual C++) A low-level (machine language) program that is understandable by a computer (for example, a PC)
What is a software? The set of all programs or a set of programs • Application software • Programs designed to perform specific tasks and are easy to use • System software • Programs that support the execution and development of other programs Two major types • Operating systems • Translation systems (compilers & linkers)
Common application software: • Microsoft Word, WordPerfect • PowerPoint • Netscape, IE • PhotoShop, Photo-Paint • Quick Time • Operating System (OS) • Windows (DOS, NT, XP, …), Unix (Linux, Solaris, …)
We teach C++, Why? • C++ is one of the most popular languages • C++ (originally C) • Basic, Pascal, Java, Perl, Cobol, Scheme, Lisp, Smalltalk, Ada, … • C++ is portable (runs on PC, Machintosh, Unix, Mainframes …) • C++ is widely used in industries (almost by everyone) • C++ is not easy to learn • The most common versions of C++: • Microsoft Visual C++ • Eclipse • g++ (for Unix machines) C++ C
Programming or Software Development • Editing (to write the program) • Compiling (creates .obj file) • Linking with compiled files (creates .exe file) • Object files • Library modules • Loading and executing • Testing the program debug
Integrated Development Environments (IDE) Combine all of the capabilities that a programmer would want while developing software (VC++, Eclipse) • Editor • Compiler • Linker • Loader • Debugger • Viewer builder