Programming Fundamentals: Lecture 1 PDF

Summary

This document is a presentation on programming fundamentals, specifically focusing on lecture 1. It covers the introduction to the course, course prerequisites, examination policy, and attendance policy. The document also includes information about recommended books, course evaluation, and the introduction of various computer concepts such as hardware, software, and their relationship.

Full Transcript

Programming Fundamental Lecture-1 Today’s Lecture  Introduction to Course & Pre-requisite (Background)  Course Examination Policy (Quizes, Assignments, Mid Term & Final Term)  Course Attendance Policy  Introduction to computer & Computer Software  Compute...

Programming Fundamental Lecture-1 Today’s Lecture  Introduction to Course & Pre-requisite (Background)  Course Examination Policy (Quizes, Assignments, Mid Term & Final Term)  Course Attendance Policy  Introduction to computer & Computer Software  Computer Environments  Different Programming Languages (Overview)  C++ - Introduction 2  Problem Analysis & Solution Design Course Prerequisite (Background & Objectives)  Students with little or No prior programming experience  Understand computational approach to problem solving  have Good mathematical Skills  Course Objective:  aims to provide students problem solving skills  Enable students to analyze problem and write solutions in C++ 3 Course Examination Policy  Quiz on Due date & Time (no retake for missed one)  Assignment on Due date and Time (No acceptance after due date & time)  Either you are Pass or Fail (19 in Sessional & 29 in Final means 19 & 29, No extra marks will be awarded from teacher side)  Sessional & final are different you need to pass them individually (no marks transfer from either side)  All excuses and requests for increasing marks 4 Course Attendance Policy  80 % Attendance required to appear in final examination 5 Recommended Books  C++ Programming From Problem Analysis to Program Design Sixth Edition D S Malik  C++ How to Program Ninth Edition Paul Deitel & Harvey 6 Course Evaluation Criteria  Programming 5-10 % Assignments (Maximum 02) Class Participation (Presentation/Discussion/Non Graded Quizzes Weekly) Quizzes 10 – 15% (Minimum 04) 20  Mid Term % 60  Examinatio % No Compromise on Marks (What you get is actually what n you deserve) 7  Final Term Programming Fundamentals 8 Introduction to Computer What is Computer:  A device that takes the data as input , process it and then return the result as an information(output). Input Data Processing Output (Data)  Any calculating device that automate the work.  A computer is a general purpose device that can be programmed to carry out a set of arithmetic or logical operations automatically. 9 Introduction to Computer Components of Computer:  Computer system made up of two major components Computer System Hard ware Software 10 Introduction to Computer Hardware  Computer hardware is the collection of physical elements that constitutes a computer system.  In simple all visible and touchable parts of computer 11 Introduction to Computer Software:  Software is a program that enables a computer to perform a specific task, as opposed to the physical components of the system (hardware).  Computer software, or simply software is any set of machine-readable instructions that directs a computer's processor to perform specific operations. 12 Introduction to Computer H/W& S/W Relationship  Nothing useful can be done with the hardware on its own & software can’t be utilized without hardware  Both hardware and Software are Complimentary to each other 13 Computer Software Software Categories 14 Computer Software System Software  Operating system is a program that manages interactions between:  users and hardware; operating system is an interface between computer hardware and user software;  hardware and software;  Device... and so are Drivers muchSoftware use to communicate between more. the devices and computers.  Utility Software Perform a very specific task, usually related to managing system resources e.g. utility compression, defragmentaion Computer Software Application Software:  Application software is a set of one or more programs designed to carry out operations for a specific application. Application software cannot run on itself but is dependent on system software to execute. 16 Computer Environment Personal Computer 17 Computer Environment Time Sharing my sub kuch centeral computer ky sath connected hota hy Environment 18 Computer Environment Client/Server is my hub ky sath sub computers connected hotyn hyn jin my aik host hota hy or baki clients hotyn hyn host baki clients ko data share karta Environment hy 19 Computer Languages it is used to get data from data base and not to make programe database aik file ko dusri file sy logically attach hoti hy or ya physically attach nii hoti or is my aik file sy dusri file data transfer ho jata hy 20 Computer Languages Machine 0 and 1 binary Languages  digits Machine code or machine language is a set of instructions executed directly by a computer's Central Processing Unit (CPU).  While easily understood by computers, machine languages are almost impossible for humans to use because they consist entirely of numbers. 21 Computer Languages it is also called symbolic Assembly machine code collection of MNEOMONIC is called assembly Language  Low level Language and just one level higher than machine language  Works directly with microprocessor  Embedded Systems depends on Assembly language 22 Computer Languages High Level languages  language with strong abstraction from the details of the computer  may use natural language elements  Easier to use  making the process of developing a program simpler and more understandable  programs written in a high-level language must be translated into machine language by a compiler or interpreter. 23 C++ - Introduction 24 C++ - Introduction History of C++  The C language was developed in late 60’s and early 70’s, in Bell Laboratories.  Before this B and BCPL language were invented to write the Operating system.  Dennis Ritchie developed a general purpose language, called C language, by using different features of BCPL and B languages. 25 C++ - Introduction integrated development envirment 26 C++ - Introduction ya software hota hy jo humy programe likhny my help karta hy What is hum programe notepad py bhi likh saktyn hyn lakin us py feauters nii hoty sary IDE my asani different functions ki collection hoti hy jis ki wajha sy humy hoti IDE?  An integrated development environment (IDE) or interactive programe likhny my hy development environment is a software application that provides comprehensive facilities to computer programmers for software development.  Program is created in Editor and stored on Disk.  C++ program is stored with extension “.cpp” 27 C++ - Introduction ya compiler ko pehly hi instruction dy deta hy What is kun ky ya builtin function hy ager header file add nii karyn gy c ++ my toh hamara toh error a jay ga. Preprocessor?  The preprocessors are the directives, which give instruction to the compiler to preprocess the information before actual compilation starts  All preprocessor directives begin with #, and only white- space characters may appear before a preprocessor directive on a line. Preprocessor directives are not C++ statements, so they do not end in a semicolon (;).  For example  #include  #define PI 3.14159 28 C++ - Introduction sab sy pehly source file ko compiler compile karta hy or ya syntax error show karta hy ager ho or ya logical error or What is runtime or programe errorrun show karnii kykarta humy dy deta hy ab ya sab sy pehly source file ko object file my convert karta hy or object file link karwati hy hamari header file jin ko hum ny inlcude karwai hoti hy or jo hamari libararies hotyn hyn Compiler? un ky sath link karta phir load  A compiler is a computer program that processes statements written in a particular programming language (source code) and turns them into machine language (object code) that a computer processor uses. karta hy phir ya humy aik assembly form my convert karta hy phir ya binary form my conver karta hy exe file my or humy aik out genrate kar ky dy deta hy 29 C++ - Introduction Compiler vs. Interpreter Compiler Interpreter Takes Entire program as Takes Single instruction as input input Intermediate Object Code is No Intermediate Object Generated Code is Generated Program need not be Program is translated compiled every time every time Errors displayed after Errors displayed for every compilation instruction interpreted (if any) 30 C++ - Introduction What is is a program used to take one or more object file genrated by compiler and combine them in to a single libarary file Linker?  a program used links to the with a compiler or assembler to provide libraries needed for an executable program.  a program that takes one or more object files generated by a compiler and combines them into a single executable file, library file, or another object file. 31 C++ - Introduction What is Loader?  a loader is the part of an operating system that is responsible for loading programs and libraries.  A loader loads the programs into the main memory from the storage device. 32 C++ - Introduction What is Debugger?  a computer program that assists in the detection and correction of errors in computer programs.  used to correct the logical errors  control our program while it is running  stop the execution of program at some point and can check the values in different variables, can change these NOTE: VARIABLES WILL BE DISCUSSED IN values etc. NEXT LECTURE 33 Programming With the Problem Analysis – Coding – Execution  Programming Cycle isprocess of Problem Solving  Algorithm – A step by step problem solving process in which a solution is arrived at in a finite amount of time  Three Steps in problem solving 1. Analyze the problem 2. Implement the algorithm 3. Maintain the program by using and modifying 34 Programming With the Problem Analysis – Coding – Execution Cycle 35 Problem Analysis & Solution Design  Good Problem Analysis produce effective Solution  Following are the keys to write good program  Paying attention to detail  Think about reusability  Think about user interface  Think computer is a dump machine  Comment code library. 36 Problem Analysis & Solution Design Paying attention to detail  Always analyzes the problem statement very carefully and in detail  Don’t conclude result by considering one aspect only  Pay attention to all the aspects of the problem  Pay attention to the calculations involved in the program  Think about the flow of information provided  Think Logically about the programstatement 37 Problem Analysis & Solution Design Think about reusability  always keep in mind that it could be reused at some other time to solve same kind problem Think about Interface  provide an easy to understand and easy to use interface that is self explanatory. 38 Problem Analysis & Solution Design Think computer as dump  Computers are incredibly stupid. They do exactly what you tell them to do: no more,  no less-- unlike human beings. Computers can't think by themselves. Comment code library  Always comment the code liberally  Comment statements do not affect the performance of the program  Comments are not compiled by the compiler  No Memory is used  Comments are used to explain the functionality of certain piece of code  Helps other programmers and yourself for understand code at later stages 39 40

Use Quizgecko on...
Browser
Browser