cis 260 computer programming i in c
DESCRIPTION
CIS 260 Computer Programming I in C. Prof. Timothy Arndt. Office location : BU 331 Office hours : 12:30pm – 2:30pm TTH, 7:00pm-8:00pm TH Office Phone : 687-4779 E-Mail : [email protected]. Course Objectives. Develop algorithmic problem solving skills - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/1.jpg)
CIS 260 Computer Programming I in C
Prof. Timothy Arndt
![Page 2: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/2.jpg)
Office location: BU 331
Office hours: 12:30pm – 2:30pm TTH, 7:00pm-8:00pm TH
Office Phone: 687-4779
E-Mail: [email protected]
![Page 3: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/3.jpg)
Course Objectives
Develop algorithmic problem solving skills Understand modern software engineering
techniques for the design of program solutions
Learn the ANSI C programming language
![Page 4: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/4.jpg)
Course Overview
Introduction to computers & programming Problem solving; variables; expressions,
printf Top down design; functions Selection structures; if and switch
statements Repetition and loop statements
![Page 5: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/5.jpg)
Course Overview
Modular programming Data types and operators Arrays Strings Structure and Union Types File Processing Pointers and dynamic memory allocation Stacks, Queues, Binary Trees
![Page 6: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/6.jpg)
Texts
Problem Solving and Program Design in C, Hanly and Koffman, Addison-Wesley, 1996.
![Page 7: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/7.jpg)
History of Electronic Computers
First electronic computer built in late 1930’s by Atanasoff and Berry
First general purpose computer called ENIAC, 1946
These computers used vacuum tubes. Later computers used integrated circuits, LSI, VLSI
![Page 8: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/8.jpg)
Categorization of Computers
Microcomputers Workstations Mainframes Supercomputers Minicomputers Servers
![Page 9: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/9.jpg)
Computer Hardware
Main memory Secondary memory Central processing unit Input devices
– Keyboards
– Mouses
Output devices– Monitors
– Printers
![Page 10: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/10.jpg)
Memory
The memory of a computer is an ordered sequence of storage locations called memory cells
Each memory cell has a unique address The data stored in a cell are called the
contents of the cell A cell may contain diverse types of data -
numbers, characters, or program data
![Page 11: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/11.jpg)
Bytes and bits
A memory cell is a grouping of smaller units called bytes.
A byte is the amount of storage required to store a single character
A bit (binary digit) is the smallest unit a computer can deal with
A bit is either 0 or 1
![Page 12: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/12.jpg)
Storage and Retrieval of Information in Memory To store a value in a memory cell, the
computer sets each bit of the cell to 0 or 1, destroying the previous values
To retrieve a value from a memory cell, the computer copies the contents of the cell to another area
![Page 13: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/13.jpg)
Main memory
Random access memory (RAM) is volatile (data is lost when the computer is turned off).
Read only memory (ROM) is non-volatile and is often used to store the startup instructions of the computer
Cache memory is fast RAM
![Page 14: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/14.jpg)
Secondary Storage Devices
Disk drives are read-write random access devices with files organized in directories and subdirectories– Hard disks– Floppy disks
CD-ROM drives are (usually) read-only random access devices
Tape drives are read-write sequential access devices
![Page 15: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/15.jpg)
Central Processing Unit
Coordinates all computer operations Performs arithmetic and logical operations
on data Stored programs are executed in a cycle of
instruction fetch, instruction decode, data fetch, instruction execute, result store sequences
![Page 16: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/16.jpg)
Input/Output Devices
I/O devices allow us to enter data for a computation and observe the results of the computation
Keyboard Mouse Monitor Printer
![Page 17: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/17.jpg)
Programming Languages
Machine languages are the native languages of the computer and are coded as strings of 0’s and 1’s
Assembly languages substitute symbolic names for strings of 0’s and 1’s
High-Level Language instructions correspond to sequences of assembly language instructions and are easier to read/write
![Page 18: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/18.jpg)
Relationship Between High-Level and Machine Languages In order to be executed by a computer, a
program written in a high-level language (source program) must be translated to machine language
The translator is called a compiler The resulting program is called an object
program
![Page 19: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/19.jpg)
Operating System
The software which controls the operation of a computer is called the operating system
Operating systems may have graphical interfaces (GUIs) command line interfaces (CLIs) or both
![Page 20: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/20.jpg)
Software Development Method
Specify the problem requirements Analyze the problem Design the algorithm to solve the problem Implement the algorithm Test and verify the completed algorithm Maintain and update the program
![Page 21: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/21.jpg)
Case Study: Miles to Kilometers
Analyze the problem Problem input: distance in miles Problem output: distance in kilometers Additional constraints on the solution?
![Page 22: CIS 260 Computer Programming I in C](https://reader036.vdocument.in/reader036/viewer/2022062517/56812d0a550346895d91dd73/html5/thumbnails/22.jpg)
Design
Algorithm – Get the distance in miles– Convert the distance to kilometers– Display the distance in kilometers
Refine the algorithm– The distance in kilometers is 1.609 times the
distance in miles