Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Course Code: CS-111  Instructor: Isra naz(Lecturer, Deptt of Computer Science, University of Wah, Wah Cantt).  Contact Information: [email protected] Assessment %Age Assignments/ 7.5% + 11.25% = Quizzes 18.75% Viva/Sessional 10% + 15% = 25% Mid Ter...

Course Code: CS-111  Instructor: Isra naz(Lecturer, Deptt of Computer Science, University of Wah, Wah Cantt).  Contact Information: [email protected] Assessment %Age Assignments/ 7.5% + 11.25% = Quizzes 18.75% Viva/Sessional 10% + 15% = 25% Mid Term Exam 22.5% Final Term Exam 33.75% Total 100 Assignments  Assignments will be due at the beginning of Surprise/ Announced quizzes to the class. Under normal circumstances, assess the understanding of taught late work will not be accepted. topics.  Students are expected to do their own assignments.  Plagiarism will be observed strictly. Revise the topic covered in class the same day. Complete the tasks given, you might get bonus points for that. ☺ Feel free to consult me during my office hours. Show sensibility in your conduct. Learning should be your primary objective. Attendance will be marked within 15 minutes at the start of the class. 80% of your attendance is mandatory. Zero tolerance policy on attendance, discipline in class during lectures. Assignments must be submitted on time, no late submissions. In case of copied assignment both parties will be given zero. Don’t miss your Classes, Quizzes, Presentations, Assignments and Projects/Presentations. You all need to be a good human being.  The key objectives of this course include are: To familiarize students with basic structured programming concepts. To emphasize upon problem solving and algorithm designing. To Design and implement algorithms to solve real world problems. To understand the importance of modular programming structure and reusability. Upon successful completion of this course, students will: 1. Understand basic problem-solving steps and logic construct. 2. Apply basic programming concepts. 3. Solve real world problems by designing and implementing algorithms. PLOs/CLOs CLO1 CLO2 CLO3 PLO1 (Academic Education) PLO2 (Knowledge for Solving Computing Problems) PLO3 (Problem Analysis) PLO4 (Design/Development of Solutions) PLO5 (Modern Tool Usage) PLO6 (Individual and Teamwork) PLO7 (Communication) PLO8 (Computing Professionalism and Society) PLO9 (Ethics) PLO10 (Life-long Learning)  Computer basics  Problem solving tecnhniques  Basics of C++ (Variables, Constants, Data types etc.).  Conditional statements  Iterative statements  Jump statements  Arrays & Functions  Structures & Pointers  String Handling  Static vs. Dynamic memory allocation  Exception Handling  File Handling  Text Books: Problem Solving and Program Design in C++, by Jeri R. Hanly & Elliot B. Koffman, 7th Edition 2012, ISBN: 978-0132936491  Reference Books: Object Oriented Programming in C++ by Robert Lafore, 2001, ISBN: 978- 0672323089  C++ Primer, by Stanley B. Lippman, Josee Lajoie, and Barbara E. Moo, 5th Edition 2012, ISBN: 978-0321714114  Von Neumann Architecture  Computer Organization  Data vs. Information  Data Hierarchy, Programming languages  High level and low level languages  Syntax vs. Semantics  Language processor/ Translators  A computer is a digital electronic machine that can be programmed to carry out sequences of arithmetic or logical operations (computation) automatically. Modern computers can perform generic sets of operations known as programs. These programs enable computers to perform a wide range of tasks. 13  Von-Neumann proposed his computer architecture design in 1945 which was later known as Von-Neumann Architecture.  It consisted of a Control Unit, Arithmetic, and Logical Memory Unit (ALU), Registers and Inputs/Outputs.  Von Neumann architecture is based on the stored-program computer concept, where instruction data and program data are stored in the same memory. This design is still used in most computers produced today.  The basic structure is like, 14 A Von Neumann-based computer: ◦ Uses a single processor ◦ Uses one memory for both instructions and data. ◦ Executes programs following the fetch-decode-execute cycle Object-Oriented Programming Lecture 2 15 16 3 basic components are: ◦ Central Processing Unit ◦ Buses ◦ Memory Unit 17  Data is a collection of facts, while information puts those facts into context.  Data is raw and unorganized, information is organized.  Data points are individual and sometimes unrelated. Information maps out that data to provide a big-picture view of how it all fits together. 18 A set of instructions that tells a computer what to do. Computer programs are written in programming languages The programmer develops programs to instruct the computer how to process data to convert into information. A Programming Language is ◦ A special purpose and limited language ◦ A set of rules and symbols used to construct a computer program ◦ A language used to interact with the computer  There are two types of programming languages ◦ Low level languages ◦ High level languages  These languages are near to computer hardware and far from human languages  Computer can understand these languages easily  Writing a program in low level languages require a deep knowledge of the internal structure of computer hardware  Low level languages are of two types: ◦ Machine Language ◦ Assembly Language ◦ A type of language in which instructions are written in binary form. ◦ It is the only language that is directly understood by computer ◦ Instructions specify operations and memory cells involved in the operation ◦ Program can be executed very fast ◦ It is machine dependent ◦ Difficult to understand ◦ Modification requires a lot of time ◦ Also known as first generation language It is one step higher than machine language Inassembly language, symbols are used instead of binary code These symbols are called mnemonics Also called as symbolic language Program written in assembly language is easier to write and modify Mostly used in writing system software It is also known as second generation language Example: Load Price Add Tax Store Cost A type of language that is close to human language It uses statements consisting of English-like keywords such as "FOR", "PRINT" or “IF“,... etc. Eachstatement corresponds to several machine language instructions (one-to- many correspondence). Much easier to program than in assembly language. Data are referenced using descriptive names Operations can be described using familiar symbols Example: Cost := Price + Tax  Procedural Languages  Predefined set of statements  Execute sequentially  User need to tell the computer both “what to do” and “how to do” e.g. FORTRAN, BASIC, COBOL, C etc.  Non Procedural Languages  User only need to tell the computer “what to do” not “how to do”  It can be used by non-technical user to perform a specific task  For Example, SQL  Object-Oriented Languages  Program written on the basis of objects  An object is a collection of data and function  Object may represent a person, thing, or place in real world  In OOP, data and all possible functions are grouped together  Easier to learn and modify  C++ and Java are popular object-oriented languages Syntax: ◦ The structure of strings in some language. ◦ The structure of the expressions, statements, and program units ◦ A language's syntax is described by a grammar. ◦ The syntax of a programming language describes which strings of of characters comprise a valid program. Semantics: ◦ The meaning of the expressions, statements, and program units ◦ The semantics of a programming language describes what syntactically valid programs mean, what they do.  Computer understand only machine language.  A program written in high-level or assembly language cannot be run on a computer directly.  It must be converted into machine language before execution.  Language processor or translator is a software that converts these programs into machine language  Every computer language has its own translator  Types of language processor are  Compiler  Interpreter  Assembler Compiler ◦ A program that converts another program from some source language (or high-level programming language / HLL) to machine language (object code) as a whole. ◦ Program written in HLL is called source program ◦ Compilers convert source program into machine code is known as object program Source Assembly Program Compiler Language Assembly Assembler Machine Language Language The compiler checks each statement in the source program and generates machine instructions. Compiler also checks syntax errors in the program. A source program containing an error cannot be compiled. Source program ◦ The form in which a computer program, written in some formal programming language, is written by the programmer. ◦ Can be compiled automatically into object code or machine code or executed by an interpreter. ◦ Pascal source programs have extension ‘.pas’ Object program ◦ Output from the compiler ◦ Equivalent machine language translation of the source program ◦ Files usually have extension ‘.obj’ Executable program ◦ Output from linker/loader ◦ Machine language program linked with necessary libraries & other files ◦ Files usually have extension ‘.exe’ A program that pulls other programs together so that they can run. Most programs are very large and consist of several modules. Even small programs use existing code provided by the programming environment called libraries. Thelinker pulls everything together, makes sure that references to other parts of the program (code) are resolved.  A program that converts one statement of a program at a time  It executes this statement before translating the next statement of the source program  If there is an error in the statements, the interpreter stops working and displays error message  Advantage:  Error is found immediately. So, the programmer can correct errors during program development  Disadvantage:  It is not very efficient. It does not produce an object program.  It must convert the program each time it is executed  Visual Basic uses interpreter  It translates the instruction of an assembly language into machine language Questions?

Use Quizgecko on...
Browser
Browser