Introduction to Programming and Problem Solving (CS101) Lecture 1 PDF

Document Details

TolerableWoodland39

Uploaded by TolerableWoodland39

Faculty of Computer Science and Information Technology

Ibrahim Shawky

Tags

programming computer science introduction to programming software development

Summary

This lecture provides an introduction to programming and problem-solving concepts, covering fundamental topics like algorithms, pseudocode, and flowcharts. It also details software development and introduces various types of programming languages, including low-level and high-level languages.

Full Transcript

Introduction to Programming and Problem Solving (CS101) Lecture 1 Prepared by/ Ibrahim Shawky Course description  This course aims to provide a fundamental understanding of the concepts underlying software development.  Basic software engineer...

Introduction to Programming and Problem Solving (CS101) Lecture 1 Prepared by/ Ibrahim Shawky Course description  This course aims to provide a fundamental understanding of the concepts underlying software development.  Basic software engineering principles and programming skills.  The course will be taught using a structured approach to programming. Course objective  The course will enable students to: 1. Develop Problem-Solving Skills  Understand the fundamentals of problem-solving using computational methods, including algorithms, pseudocode, and flowcharts. 2. Introduce Programming Concepts  Gain an introduction to programming constructs such as variables, data types, control structures, arrays, strings, and functions.  Gain familiarity with programming languages, compilers, and interpreters, and understand the role they play in software development. 3. Practice Algorithmic Thinking  Apply different algorithmic approaches to solve basic programming problems and learn how to use recursion and loops effectively. 4. Enhance Debugging and Testing Skills  Learn how to identify and fix programming errors and ensure that programs run efficiently and correctly. Textbooks  C# 10.0 in a Nutshell: The Definitive Reference, by Joseph Albahari and Ben Albahari, 2022.  Head First C#: A Brain-Friendly Guide, by Andrew Stellman and Jennifer Greene, 2012 Course syllabus  This course covers the following topics:  The difference between the various algorithmic methods is: Pseudocode and Flowchart, Steps in solving a problem using a computer, Sample problems and solutions using the various methods of algorithm.  Programming Languages, Compilers, and Interpreters, compilation process.  Types of Errors in Programming.  Fundamental programming constructs: Syntax and semantics of a higher-level language.  simple data types, statement sequencing, input/output, control structures, looping, recursion, array and string data structures, functions, basic algorithms, testing, and debugging.  Modeling and problem-solving skills are applicable to programming at this level. Prerequisites  No Prerequisites Grade Distribution Assessment strategy Max degree Practical exam 10% Midterm 15% Quizzes, Assignments and Class 10% Participation Oral exam 5% Final Exam 60% Question type (Final exam, Midterm, and Quizzes)  Exam will contain the following question type: Question type Max degree Multiple choice questions 10%-20% Define 5%-10% long answer 10%-20% Computational 30%-50% Laboratory works Lab Duration Design flow chart and pseudo algorithm 2 weeks Programming with C# using Visual Studio 10 week Computer System  A computer is an electronic device that stores and processes data.  A computer includes both hardware and software.  In general, hardware refers to the touchable physical parts of the computer.  The software part provides the instructions that control the behavior of the physical units and redirect them to perform specific tasks. Programming language  Programming Languages is a set of words, symbols, and codes that enable a programmer to communicate instructions to a computer.  These languages are designed for specific purposes, such as scientific applications, business solutions, or web page development.  There are Two types of languages are  Low-level  High-level. low-level language  A low-level language is a type of programming language that is closer to machine code and hardware instructions, making it more difficult for humans to read and write but more efficient for the computer to execute.  A low-level language is a programming language that is machine dependent.  Each instruction In A low-level language equates to a single machine instruction.  Low-level language has two types are:  Machine languages  Assembly languages. Compare between machine and assemble languages Machine language Assemble language Use a series of binary digits (1s and 0s) A programmer writes instructions using symbolic instruction codes Such as use Add for addition A combination of numbers and letters that Use meaningful name that identifies represents binary digits variable. Such as program can use the name rate to refer storage location that contains a pay rate. Example: A letter is represented as Example: Add A, B, C → means that add B 01001000 in the ASCII code. and C and store the result in A Machine language is considered the Assembler is used to convert assembly language of the computer, so it doesn't source program into machine language. need to be converted to another form. High-level language  A high-level language is a type of programming language that is closer to human languages and further from machine code.  It is designed to be easy to read, write, and understand, allowing programmers to focus on problem-solving and algorithms rather than the underlying hardware.  There are hundreds of high-level programming languages such as:  Java  C  C++  Python  PHP  Perl  Ruby High-level language  High level languages are machine independent (Can run on many different types of computers and operating systems).  It’s called, also, procedural languages.  Procedural Languages: writes instructions that tell the computer what to accomplish and how to do it.  It uses a series of English-like words to write instructions.  The code is called the source program.  Each instruction In A high-level language equates to a multiple machine instruction.  X = 4;  Y = 5;  result = X * Y; Translator  Because high-level language is human-readable and far from machine code, a specific tool is needed to translate the code into a form that the computer can execute.  There are three tools that can translate the code into a form the computer can execute:  Assembler  interpreter  compiler. Assembler  A translator program that convert source code from assembly language into target machine language.  The following Figure shows the process of translating assembly code into its corresponding target machine code using an assembler. Compiler  Compiler is a specialized software tool that translates code written in a high-level language into machine code or an intermediate form that a computer's processor can execute.  Compiler translates the entire source code of a program into machine code before the program is executed.  This means that once the code is compiled, the resulting executable file can be run multiple times without the need for further translation.  The compiler checks the source program for errors. Interpreter  An interpreter translates and executes the code line by line at runtime.  This means that the program is executed immediately, without the need for a separate compilation step.  Interpreters are useful for scripting languages and rapid development because they allow for quick testing and debugging. Compare between compiler and interpreter Aspect Compiler Interpreter Translation Translates the entire source code Translates and execute one into machine code before statement at a time (Statement execution. by statement) Execution Produces an executable file that Executes code directly, without can be run multiple times without creating a separate executable further translation. file. Performance Generally faster execution since Generally slower execution due the code is translated and to line-by-line translation. optimized beforehand. Error Detection Errors are detected after the Errors are detected as the code is entire code is compiled. executed, which can make debugging easier for specific lines but harder for overall logic. Examples C, C++, Rust Python, JavaScript, Ruby Exercise 1. Compare between interpreter and complier? 2. Compare between high level and low-level languages? 3. Compare between machine and assemble languages? Output devices

Use Quizgecko on...
Browser
Browser