TK 1914 : C++ Programming Introduction to Programming WHAT IS PROGRAMMING? • Programming is a process of producing computer programs. • A computer program contains instructions to a computer on how to perform a certain task. • A program is written in a programming language. There are so many programming languages. Some examples: C, C++, Java. FTSM :: TK1914, 20112012 WHY LEARN PROGRAMMING? • There are many reasons why one would want to learn programming. Among them: – Programming is an important skill needed to work in the IT industry. – You can be creative through developing software. • Creating software is one of the most creative activities that humans undertake. Through applying creativity, it is possible to create great software. • Imagine the world without: – web browser, facebook – email – instant messaging FTSM :: TK1914, 20112012 WHY LEARN PROGRAMMING? – sms – handphones – Windows, MacOSX, Linux, etc – You have the ability to customize or modify software to your needs. – You can earn money doing software programming. – Programming can be thrilling, challenging and fun. FTSM :: TK1914, 20112012 PROCESS • A programmer uses a programming language to write a program. • The instructions contained in a program are normally readable by humans. • However, they cannot be executed on a computer unless they are translated to machine code which is the native language of the computer. • The process of translating instructions written by a human to machine code is called compiling. FTSM :: TK1914, 20112012 PROCESS • The set of instructions in a program written by a programmer is sometimes referred to as the program source code. • The set of compiled instructions of a program is also referred to as the program's executable code. • A program's executable code can be run directly on a computer. FTSM :: TK1914, 20112012 PROCESS program source code (e.g. in C++) compilation (e.g. using g++) program executable code execution (e.g. using g++) FTSM :: TK1914, 20112012 REALISTIC EXPECTATIONS • Imagine a five-year old boy whose ambition is to become a famous writer. • How old is the boy when he could – – – – – – – memorize all the letters of the alphabet? spell words correctly? write sentences correctly? write a short composition? write a short story? write a novel? write a play? FTSM :: TK1914, 20112012 • Do not expect the programs that you are able to produce in this course to be of the same standard as that of the software you are familiar with. – The programs that you write are console-based rather than GUI-based. – What you will learn in this course are the fundamentals of programming. – The programs that you are able to produce at the end of this course are comparable to a composition or a short story. FTSM :: TK1914, 20112012 • Writing programs is like solving mathematical problems. – You become proficient in programming through lots of practice, not through memorizing facts. – Make programming your hobby! FTSM :: TK1914, 20112012 SAMPLE OF FINAL YEAR PROJECTS FTSM :: TK1914, 20112012 Bluetooth-Based Attendance Taking System • Developed by: Liong Kah Man, 2008 • Supervisor: Dr Sufian Idris. • Description: – A system for taking attendance during lecture using bluetooth communication between students' and lecturer's mobile devices (handphones, PDA, etc). – The system also includes a web-based component for uploading and accessing attendance data, producing reports, etc. • Programming language used: Java. FTSM :: TK1914, 20112012 Take attendance using bluetooth-based mobile device Upload/Access attendance data, Produce report, etc FTSM :: TK1914, 20112012 Sample Screenshots Mobile Component (Lecturer's Mobile Device) Main Menu List of Student Attendance FTSM :: TK1914, 20112012 Sample Screenshots Web-Based Component Screen for Accessing Attendance Records for a Particular Class FTSM :: TK1914, 20112012 Bluetooth-Based Mobile Game: UNO • Developed by: Low Yean Lee, 2008. • Supervisor: Dr Sufian Idris • Description: – Enables a group of people to play the UNO game on their Java-enabled handphones with bluetooth capability. • Programming language used: Java. FTSM :: TK1914, 20112012 Player (Master) BLUETOOTH CONNECTION Player (Slave) Player (Slave) Player (Slave) FTSM :: TK1914, 20112012 Sample Screenshots Splash screen Starting Menu Hint Pop-up Main Playing Screen Winner Announcement Screen FTSM :: TK1914, 20112012 Sudoku: Mobile game application • Developed by: Sam Pin Sang (A103482), 2008 • Supervisor: Pn. Marini • Description: – game application on portable wireless devices such as hand phone and Personal Digital Assistant (PDA). • Programming language used: Java. • Tested on a Nokia 6630 hand phone. FTSM :: TK1914, 20112012 Sudoku: Mobile game application Start the game Other options FTSM :: TK1914, 20112012 Sudoku: Mobile game application Other options: FTSM :: TK1914, 20112012 PhotoDJ • Developed by: Low Kok Siang (A108418), 2008 • Supervisor: Pn. Rodziah. • Description: – A software to manipulate a photo: change color, etc. • Programming language used: VB.NET FTSM :: TK1914, 20112012 SAMPLE OF COURSE PROJECTS FTSM :: TK1914, 20112012 TR3423 PENGATURCARAAN DAN SIMULASI ROBOT FTSM :: TK1914, 20112012 The robots are programmed using C++ FTSM :: TK1914, 20112012 TR2043 PENGATURCARAAN GRAFIK FTSM :: TK1914, 20112012 Programming Language used: Java and Java2D FTSM :: TK1914, 20112012 FTSM :: TK1914, 20112012 SUGGESTED READING (ROYO) • Chapter 1: An overview of computers and programming languages – – – – Brief overview of the history of computers Elements of a computer system The language of a computer The evolution of programming languages FTSM :: TK1914, 20112012