30
CS101: Introduction to Computing Computing Dr. A. Sahu Dept of Comp. Sc. & Engg. Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1

System.lec01

Embed Size (px)

Citation preview

Page 1: System.lec01

CS101: Introduction to ComputingComputing

Dr. A. Sahu

Dept of Comp. Sc. & Engg.Dept of Comp. Sc. & Engg.

Indian Institute of Technology Guwahati

1

Page 2: System.lec01

OutlineOutline• Course Attendance Reference Book• Course, Attendance, Reference Book

–CS101 : Theory–CS110 : Laboratory workWh t d t d i thi ?• What do we study in this course?

• Why should this be studied?Why should this be studied?

• How is the course structured?

2

Page 3: System.lec01

CS101 (Theory Part)CS101 (Theory Part)• Instructors: 

–G. Sagith, Ashish Anand, Amit Awekar, A SahuA. Sahu

• 75% Attendance is Mandatory • Two exam and two quiz

–Mid semester : 35%Mid semester : 35%–End semester : 55%

i %–Quiz: 10%3

Page 4: System.lec01

CS101:  Course Structure• Introduction: OS, compiler, text editors, flowchart and system;flowchart and system; 

• C Programming : Basic features and g gAdvanced features

• Data Structures: array stack queue• Data Structures: array, stack, queue, lists

• Searching and sortingb d• Intro. to object‐oriented programming

4

Page 5: System.lec01

CS101: Text & ReferencesCS101: Text & References• Text Book

–A Kelly and I Pohl, A Book on C, 4/e, Pearson Education, 1999

– A M Tenenbaum and all, Data Structures Using C, Prentice Hall India, 1996..

• References – H Schildt, C: The Complete Reference, 4/e, Tata , p f , / ,Mcgraw Hill, 2000

– B Kernighan and D Ritchie, The C Programming Language, 2/e, Prentice Hall of India, 1988.

5

Page 6: System.lec01

Web, timing, venue , g,• Course website: 

http://jatinga iitg ernet in/~cs110/http://jatinga.iitg.ernet.in/~cs110/• Class Timing & Venue

–Venue: L3

– Timing : Slot A (Division II)Timing : Slot A (Division II)• Tue:9‐10, Wed:10‐11 and  Thu:11‐12, 

• Mon 8Am ‐9AM is make up slotMon 8Am ‐9AM is make up slot

– Timing : Slot A1 (Division I)T 4 5PM W d 3 4PM d Th 2 3PM• Tue:4‐5PM, Wed:3‐4PM and Thu:2‐3PM

• Mon : 5‐6PM is make up slot 6

Page 7: System.lec01

CS110 (Lab Part)CS110 (Lab Part)• http://jatinga.iitg.ernet.in/~cs110/p //j g g / /• Venue : Computer CenterTA ill h l d O F l ill• TAs will helps and One Faculty will guide/supervise you in CC Laboratory 

• Marks:Practice Problem :30%–Practice Problem :30%

–Mid semester: 30%–End semester : 40%

7

Page 8: System.lec01

CS110 (Lab Part)CS110 (Lab Part)• Assume Every lab class is Examination

–Every week on practice problem–Every practice problem carries marks : 3–Every practice problem carries marks : 3 MarksP ti bl S tt d– Practice problem: Serve as attendance

–Copy case : Negative Marks • (if credit is 3, copy case ‐3)

– A Set of Practice Problems will beA Set of Practice Problems will be announced before Lab session start.

8

Page 9: System.lec01

CS101 Course ObjectivesCS101 Course Objectives

To learn ‐To learn • Basic principle of  computer system and 

iprogramming• Use of computer for many real life problem– Physics, Chemistry, Electrical, Mechanical

• Programming remove : Many manual calculation

9

Page 10: System.lec01

CS101 : CourseCS101 : Course • Computer System

• C Programming• C Programming • Advanced C Programming g g

D t St t & S ti d• Data Structure &  Sorting and Searching   

10

Page 11: System.lec01

CS101 : Course FlowCS101 : Course Flow 

ComputerComputer System

C ProgrammingProgramming

Advanced C Programming 

Data Structure &  

11Sorting /Searching  

Page 12: System.lec01

What Is A Computer?What Is A Computer?• An electronic device

d l f• Operates under control of instructions(software)

• Stored in its own memory unit

• It can– Accept data (input),

– Manipulate data (process),Manipulate data (process),

– Produce output from the processing.

• A collection of devices that function together• A collection of devices that function togetheras a system.

12

Page 13: System.lec01

Computer Systemp y

Processing  O/PI/P

• Keyboard, Mouse : Input

• Speaker, Monitor/Display : Output

• CPU Box : Processing13

Page 14: System.lec01

Computer System: Von Newman Memory 

I/P Processing  O/PI/P

• Input and Output

• ProcessingProcessing

• Memory : Where it store Instruction Data Intermediate compute– Instruction, Data, Intermediate compute 

14

Page 15: System.lec01

Inside PC : Motherboard 

15

Page 16: System.lec01

Inside PC: Memory Card

16

Page 17: System.lec01

Inside PC : Hard DiskInside PC : Hard Disk 

17

Page 18: System.lec01

Inside PC : Processor 

18

Page 19: System.lec01

Computer System: h hWhen you Switch on 

• Operating System boots from Hard disk • OS : Give you an environment where you work

• Different OS –Window XP/Vista/7– Linux

• Application can be invoked by clicking some IIcon

• Application: Word, Excel, Internet Explorer, Mozilla Media PlayerMozilla, Media Player

19

Page 20: System.lec01

Screen shot : Window & LinuxScreen shot : Window & Linux

• Both are equally Good and PowerfulBoth are equally Good and Powerful• Window: User friendly, prone to Virus, Commercial (Not Free: you have to Pay Money)Commercial (Not Free: you have to Pay Money)

• Linux : Robust and Freely available20

Page 21: System.lec01

Application SoftwareApplication Software• Application Software consists of programs

• That tell a computer how to produceinformation.

• Some of the more commonly used packagesare:– Word processing

– Electronic spreadsheetElectronic spreadsheet

–Database

i hi–Presentation graphics21

Page 22: System.lec01

Word ProcessingWord Processing

• used to create and printused to create and print documents. 

• A key advantage of word y gprocessing software 

• Users easily can make ychanges in documents.

22

Page 23: System.lec01

Electronic SpreadsheetsElectronic Spreadsheets

• Allows the user can do onAllows the user can do on rows and columns of numbers.  – Add, Subtract, perform user‐defined calculations

h b b• These numbers can be changed 

A d th d h t• And the spreadsheet quickly recalculates the new resultsnew results.

23

Page 24: System.lec01

Database SoftwareDatabase Software

• Allows the user toAllows the user to enter, retrieve, and update dataupdate data 

• In an organized and efficient mannerefficient manner

• With flexible inquiry d iand reporting 

capabilities.

24

Page 25: System.lec01

Presentation GraphicsPresentation Graphics

• Allows the user to createAllows the user to create documents slides to be used in making the presentations. 

• Using special projection devices  to Project 

• Slides display as they happear on the computer 

screen

25

Page 26: System.lec01

Programming: Why, What and How ?Programming: Why, What and How ? • Operating System : Linux, Window

/• Applications: Word/Excel, Media Player, Mozilla, Explorer, etc

We se it to do some tasks but don’t know inside– We use it to do some tasks, but don’t know inside contents 

• ProgrammingProgramming– Purpose : to create a program that performs specific operations or exhibits a certain desired behavior.

– Computer Language  (C , C++, Java, Fortran, Cobol)– Design our own applicationAl t f th b i i– Almost from the beginning 

– Understanding how software/application works26

Page 27: System.lec01

How to do programming • Problem: Specification 

– Example: Compute sum of N Number– Define Input {N}, Output {SUM}– How to do : Flow chart– Write the C/C++ Code in Note/Paper   

• OS, Shell/IDE, Editor:Li B h Sh ll G di /VI/Pi– Linux, Bash Shell, Gedit/VI/Pico

– Word Processor is not used to write program– TurboC/VisualC++/Kdevelop/Dev– TurboC/VisualC++/Kdevelop/Dev

• Compiler: GCC, TCC, VCC• Running: /a out• Running: ./a.out

27

Page 28: System.lec01

Flow ChartStart Start

Flow Chart

• Two methods Initialize 

Input N Input N

Two methods– Method 1

Sum= 1+2+3+ +N

;i=0; S=0

Intermediate S S iSum= 1+2+3+…+N

– Method 2

S N(N+1)/2

Sum=Sum+i

Increment ii=i+1

Sum=N*(N+1)/2

Sum = N(N+1)/2 i=i+1

i<N

Output S Output S

28End 28End

Page 29: System.lec01

C Programming in Liunx EnvironmentC Programming in Liunx Environment • OS : Linux• Editor : vi, pico, geditC il GCC (G C il• Compiler: GCC (Gnu Compiler Collection)

$ vi test.c

$ gcc test.c

$ /a out$ ./a.out29

Page 30: System.lec01

Thanks

30