Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY Fredonia Room 210, Fenton X-4694,

Slides:



Advertisements
Similar presentations
Computer Science Department Introduction To Computers and Programming Knowledge: Understand the concepts of computer, hardware, software and programming.
Advertisements

Chapter 1 An Overview of Computers and Programming Languages.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Overview of Programming and Problem Solving ROBERT REAVES.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Overview of Computers & Programming Languages Chapter 1.
COSC 120 Computer Programming
Introduction to Computers and Programming - Class 1 1 Introduction to Computers and Programming Professor Avi Rosenfeld.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
1 Lab Session-II CSIT 121 Fall 2000 Visual Studio Introduction Lab-1 Explanation and Demos Debugging Tips How to add new files to your projects How many.
1 Session-5 CSIT 121 Spring 2006 Part D due now String Rules Chapter 2 Topics Lab Demo Exercise Assignment.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
16 March, 2000 CS1001 Lecture 1 Introduction - Syllabus History of Computers Computer Components.
1 Lecture-I CSIT-120 Spring 2001 Introducing the Course Syllabus Introduction to Computers Introduction to Computer Science Information, Algorithms and.
Chapter 1: An Overview of Computers and Programming Languages
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
1 8/28/06CS150 Introduction to Computer Science 1 Professor: Chadd Williams
Introduction to C++ Programming CS 117 Section 2 and KNET Sections Spring 2001 MWF 1:40-2:30.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
Introduction to Computers and Programming
1 Lesson 1 Computers and Computer Systems Computer Literacy BASICS: A Comprehensive Guide to IC 3, 4 th Edition Morrison / Wells.
CS 115 Chapter 1 Overview of Programming and Problem Solving.
CHAPTER 1 AN OVERVIEW OF COMPUTERS AND PROGRAMMING LANGUAGES.
CS102 Introduction to Computer Programming
Computers and Programming อนันต์ ผลเพิ่ม Anan Phonphoem
Chapter 1: An Overview of Computers and Programming Languages.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
CS 161 INTRO TO PROGRAMMING I Dr. Blaise W. Liffick Fall
Introduction COMP104: Fundamentals and Methodology.
Chapter 1 An Overview of Computers and Programming Languages.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
1 nd Semester Module1 Introduction to Computer and Programming Thanawin Rakthanmanon Create by: Aphirak Jansang Computer.
Introduction to Programming Using C Introduction to Computer Programming.
1 Overview of Programming and Problem Solving Chapter 1.
Chapter 1: An Overview of Computers and Programming Languages
© 2005 By Prentic Hall1 1 University Of Palestine Essentials of Management Information Systems Kenneth C. Laudon, Jane P. Laudon Instructor: Mr. Ahmed.
Chapter 1: An Overview of Computers and Programming Languages
Overview of Programming and Problem Solving Textbook Chapter 1 1.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
1 st Semester Introduction to Computer and Programming Computer Engineering Department Kasetsart University, Bangkok, THAILAND.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Problem Solving Techniques Using Pascal Allen C.-H. Wu Department of Computer Science Tsing Hua University Hsinchu, Taiwan 30043, ROC
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
2 nd Semester Module1 Introduction to Computer and Programming อภิรักษ์ จันทร์สร้าง Aphirak Jansang
Computers and Programming ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 1 An Overview of Computers and Programming Languages.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
1 Lesson 1 Computers and Computer Systems Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Programming COMP104: Fundamentals and Methodology Introduction.
Overview of Computers & Programming Languages
Computer Science I CSC 135.
Introduction to Computer Programming
Presentation transcript:

Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY Fredonia Room 210, Fenton X-4694,

Introduction n In this course, we learn how to use the computer effectively to solve problems n Let us go over the syllabus and then start the introductory topics.

Syllabus n Textbook: Programming and Problem Solving With C++, 2 nd Edition, Nell Dale, Chip Weems and Mark Headington, Jones and Bartlett 2000 n Grading System: F Assigned Works40% F Exam-I30% F Exam-II30%

Topics F Introduction to Computers F Overview of C++ F Top Down Design F Selection F Repetition F Function Arguments F Formatting and Files F Arrays and Structures F User defined classes F Recursion

Introducing Computers n A computer is a device capable of performing computations n What is the difference between a calculator and a computer? n Answer: Taking Logical Decisions n Example: if Result=0 then R1 <= R2*R3-5; else R1 <= R2

History of Computers n 2000BC Abacus used for computations n 1890 Hollerith designs electronic census reader and later founds IBM n 1939 J. Atanasoff designs first electronic digital computer n 1946 Von Neumann proposes stored program computer n 1977 Apple Computer launched n 1981 IBM PC launched

History of Computers n 1970 UNIX first version released n 1971 Pascal language developed n 1972 C language developed n 1973 Part of UNIX implemented in C n 1985 C re-implemented as C++ n 1996 C++ standard released

Types of Computers n Microcomputers (PDA, Lap-top, Desk-top and Workstation computers) n Minicomputers and Mainframes n Supercomputers

Hardware of Computers n Computers consist of Y CPU Y Memory (Primary/Secondary) Y Input devices Y Output devices n What is a floppy drive? n What is a SIMM? n What is a modem?

Inside The Computer INPUTOUTPUT MEMORY CPU

CPU Operation n CPU is the brain of the computer n It coordinates all operations and performs specified instructions n It has to bring the instructions from main memory (fetch) n It executes the current instruction as specified (execute) n It stores the results in memory if required

Memory Operation n Memory consists of storage cells that are numbered n Computer can store and retrieve values in memory by addressing the cells and setting bits n A cell may consist of 8 bits in which case it is called a Byte n A bit can only have value 0 or 1.

Types of Memory n Main Memory consists of RAM and ROM. n ROM stores permanent settings for the computer. n RAM stores user programs temporarily when the programs are being executed n A user program cannot run if it is not loaded into RAM

Types of Memory n Secondary Memory consists of Hard disks, floppy disks, CD- ROMS, DVD’s, and tapes etc. n Hard disks contain the operating system of the computer and the user programs and data files. n Floppy disks are removable n Tapes are used for backup n CD-ROMS distribute software

Input/Output Devices n A keyboard is the most important input device. n Can you identify the most important output device? n Some non-traditional computers require other I/O devices such as control panels, digital displays n What is a NIC?

Programming the Computer n Computer speaks ‘1’ and ‘0’ n Lowest level programming language is the machine language it uses Hex or mnemonics to convey 1’s and 0’s to the computer n 0x2004= n A high-level language would resemble human-language n if price > my_limit then don’t_buy

High Level to Low Level Languages C++ Program My_var = this_data+next_data Compilation and Linking //Load R5 from Memory //Load R4 from Memory //Add R4,R5 & store result in R //Store R6 into Memory

High Level languages n Some high level languages include FORTRAN (Engineering and Science), COBOL (Business), Pascal (Instructional), Lisp (AI), C++, Java (General). n Programs written in these languages are finally translated to ‘1’s and ‘0’s before being executed

A Program’s Stages From Source to Execute Source File CompilerObject File Linker/ Loader Executable File

Sections of Programs n A program running in the computer would have n data input instructions u e.g. read (price, my_limit) n data manipulation instructions u e.g. is price > my_limit? n data output instructions u e.g. write (don’t_buy)

A Problem Solving Strategy n Assume that you have a problem to be solved on computer n Think about the problem specification and identify I/O n Plan on program design with data design and procedural design n Implement the program n Test and debug the program

NiMo’s varying rates n Example: Niagara Mohawk wants to apply different rates to its customers. If the customer burns more than 1000 units in a month, rate B is applied else rate A is applied. You need to develop a software function that can give the total charges as output given a customer’s consumption.

NiMo’s varying rates n You develop the data model for this problem n What is the input to your function? n Answer: consumption, A, B n What is the output? n Answer: charges n What formula to be used? n Answer (A or B)*consumption

Top Down Design n If you are given a complex problem, you are better off dividing it into sub-problems n Target is to let each sub-problem deal with one aspect of the software n Thus you can rapidly develop the software to solve complex problems

NiMo’s varying rates n In our example, the program can be divided into three sections: n Answer: Input, processing, output n Write a code segment to get the rates n Write a code segment to process the charges n Write a code segment to output the charges

Algorithm Development n Once given a problem, you need to develop an algorithm to solve it n An algorithm is a series of steps needed in a certain order to solve a problem n Algorithm refinement is done to break it into smaller modules n Desk check is done to make sure it will indeed solve the problem

Software Testing n Once you have coded the program, you should test it to make sure it works n Testing is related to the requirements developed in problem analysis phase n Testing is exhaustive n Testing is a specialized field

Documentation n When you develop a program, make sure that you document it properly n Documentation consists mainly of n User Guide n Administrator Guide n Comments in the source code n Description of strategy

Maintenance n A program being used requires maintenance over a period of time n What are the reasons for maintenance? n Answer: Bug discovery, finding out some limitations, future expansion of requirements n Example: yy or yyyy for year tracking

Structured Programming n Structured programming calls for Top Down modular design n Each module can be refined further until single-minded modules are achieved n Sharing of data among modules should be reduced to avoid confusion during debugging

Object Oriented Programming n An object is a data and procedural abstraction n data represents attributes n procedures represent behavior n OOP hides attributes and behavior in classes n Classes are used as templates to create objects

Think about Objects n We find objects everywhere!! n A table is an object n Table’s attributes include its height, width, material used etc. n Table’s behavior includes its usage. For example, you can study on a table or eat on a table but you cannot travel on a table!!

Think about Objects n A car is an object n The attributes of a car include its make, model, color, number of seats etc. n The behavior of a car includes stopping on applying brake, accelerating on applying gas, turning, moving from a place to another place

Objects hide information n Objects hide the attributes and behavior from others n Information hiding means the details of implementation are hidden n Objects can communicate through interfaces n Do you need to know how car brakes or accelerator work?

Our Approach n In this course, we primarily focus on structured programming n A good structured programming background would help you a lot in object oriented programming n The behavior of objects will be ultimately built from structured programming constructs

Class Work n Finish the NiMo varying rates program and test it with two sample customers. One customer will have rate A applied and the other one will have rate B applied to the monthly bill.