Introduction to Computers and Programming: KIG2007, Lecture notes of C programming

for beginners programming. find it useful

Typology: Lecture notes

2018/2019

Uploaded on 05/05/2019

nurul-athirah-1
nurul-athirah-1 🇲🇾

1 document

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
KIG2007 : Computer Programming
Introduction to Computers and
Programming
Semester 2, Session 2017/2018
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Introduction to Computers and Programming: KIG2007 and more Lecture notes C programming in PDF only on Docsity!

KIG2007 : Computer Programming

Introduction to Computers and

Programming

Semester 2, Session 2017/

Computers in industry and research

  • (^) Many of the most influential and successful businesses of the last two decades are technology companies, including Apple, IBM, Hewlett Packard, Dell, Intel, Motorola, Cisco, Microsoft, Google, Amazon, Facebook, Twitter, Groupon, Foursquare, Yahoo!, eBay and many more.
  • (^) Examples of computers usage in industry and research:
    • Electronic health records
    • Human Genome Project
    • AMBER TM Alert
    • World Community Grid
    • Cloud computing
    • Medical imaging
      • GPS
      • Robots
      • Email, instant messaging, video chat, FTP
      • Internet TV
      • Streaming music services
      • Game programming

Moore’s law

  • (^) Moore’s law: the observation that the number of transistors in a dense integrated circuit doubles approximately every two years.
  • (^) Every year or two, the capacities of computers have approximately doubled without any increase in price.

Computer organization

  • (^) Six logical units of computer 1. Input unit  (^) “Receiving” section  (^) Obtains information from input devices (e.g. keyboard, mouse, touch screens, microphone, scanner, etc.) 2. Output unit  (^) “Shipping” section  (^) Takes information processed by computer and places it on output devices (e.g. screen, printer, networks, etc.)  (^) Information can also be used to control other devices 3. Memory unit  (^) Rapid access, relatively low capacity “warehouse” section  (^) Retains information from input unit, making it immediately available for processing when needed  (^) Retains processed information until placed on output devices

Data hierarchy

  • (^) Data items processed by computers form a data hierarchy that becomes larger and more complex in structure. Complexity Database^ Database File^ File Record^ Record Field^ Field Byte^ Byte Bit^ Bit Judy EMP_NAME Judy Manager 15 Sep 2016 EMP_NAME POSITION^ DATE EMPLOYED Judy Manager 15 Sep 2006 EMP_NAME POSITION^ DATE EMPLOYED Alice Secretary 21 Jan 2011 Steve Sales person 2 May 2016 Salary File Employee Details File Training Record File 1 (^01001010) Byte (Letter J in ASCII) Bit Field Record File Database

Operating systems

  • (^) Software systems that make using computers more convenient for users, application developers and system administrators.
  • (^) The software that contains the core components of the operating system is called the kernel.
  • (^) Popular desktop operating systems include Linux, Windows and OS X (formerly called Mac OS X).
  • (^) Popular mobile operating systems used in smartphones and tablets include Google’s Android, Apple’s iOS (for iPhone, iPad and iPod Touch devices), BlackBerry OS and Windows Phone.

World Wide Web

  • (^) Allows computer users to locate and view multimedia-based documents over the Internet
  • (^) Hypertext Transfer Protocol (HTTP) – a communications protocol used to send information over the web.
  • (^) URL (Uniform Resource Locator) – specifies the address (i.e., location) of the web page displayed in the browser window.
  • (^) Hypertext Transfer Protocol Secure (HTTPS) is the standard for transferring encrypted data on the web.

What is programming?

  • (^) Programming is a core activity in the process of coming out with instructions that a computer can follow to do something.
  • (^) Programming language: systematic set of rules used to describe computations in a format that is editable by humans Problem Solve Human Instructions 10001001 11110000 10000001 00000111 . . Programming language

Machine languages, assembly

languages and high-level languages

Hardware Machine language Assembly language High-level languages (C, Java, PHP, etc.) compiler → assembler →

Programming languages

Building a C++ program

  • (^) In C++, the code is run through a preprocessor, which applies some modifications to the source code, before being fed to the compiler.
  • (^) Object files are intermediate files that represent an incomplete copy of the program.
  • (^) The linker takes those object files and the compiled libraries of predefined code that they rely on, fills in all the gaps, and spits out the final program. Editor or IDE Preprocessor Compiler Linker Loader CPU Step 1 : Write source codes Step 2 : Preprocess Step 3 : Compile Step 4 : Link edit Step 5 : Load Step 6 : Execute Build Run OUTPUT Source codes (.cpp), Headers (.h) Included files , replaced symbols Object codes (.obj, .o) Executable code (.exe) Static Libraries (.lib, .a) Shared Libraries (.dll, .so) Input

Popular integrated development

environments ( IDEs )

  • (^) Microsoft Visual Studio 201x : https://e5.onthehub.com/WebStore/ProductsByMajorVersionList.aspx? ws=c8eb7cd0-649b-e011-969d-0030487d8897&vsro=8&JSEnabled=
  • (^) Code::Blocks software: http://www.codeblocks.org/home Please refer to the “Installation and operation guide of Code::Blocks”
  • (^) Dev C++
  • (^) NetBeans
  • (^) Eclipse
  • (^) Apple’s Xcode
  • (^) CodeLite