CH01 - Introduction PDF
Document Details
Uploaded by ImpressedSynergy3690
Mansoura National University
Dr-Mohamed Handosa
Tags
Related
- C Programming Introduction PDF
- A Beginner’s Guide to Programming Logic, Introductory PDF
- Lecture Notes 1 - Introduction and Importance of C PDF
- Introduction to Computers, the Internet and the Web PDF
- Introduction to Programming and Problem Solving (CS101) Lecture 1 PDF
- Unit 1-Introduction To Programming And Computer Science PDF
Summary
This document is a set of lecture notes covering fundamental concepts in computer science and programming. The document explores computer systems, programming languages (including C#), algorithms, problem-solving, and different programming methodologies.
Full Transcript
CH01- Introduction Based On Dr-Mohamed Handosa’s Lecture Notes 1.1 Computer System Components A computer system can be divided into four components: 1- Hardware: provides the basic computing resources for the system (e.g., the Central Processing Unit (CPU), the memory, and the Input/Output (I/O)...
CH01- Introduction Based On Dr-Mohamed Handosa’s Lecture Notes 1.1 Computer System Components A computer system can be divided into four components: 1- Hardware: provides the basic computing resources for the system (e.g., the Central Processing Unit (CPU), the memory, and the Input/Output (I/O) devices). 2- Application programs: define the ways in which these resources are used to solve users’ computing problems (e.g., word processors, spreadsheets, compilers, and Web browsers). 3-Operating system: controls the hardware and coordinates its use among the various application programs for the various users (e.g., Microsoft Windows, Apple iOS, Google Android). 4- Users: commonly humans but can be machines as well. 1.2 Computer System Organization A modern general-purpose computer system consists of: 1. one or more CPUs (or processors) 2. a number of I/O devices connected through 3. a common bus that provides access to shared memory, The user can provide input using an input device and receive output via an output device. 1.3 Computer Software a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work. A program is a collection of instructions to perform a specific task. 1.4 Programming Languages The programmer writes the source code representing the program instructions using one of the programming language. There are several programming languages with different syntax قواعد كتابةand features. The programmer must follow the rules of the programming language in use. Source code is converted into a computer program using the compiler The compiler itself is a program that can convert source code into an executable program. معلومات لالطالع فقط Optional Games to Practice Programming Lightbot: – https://lightbot.com/ Coding Planets 2 – https://play.google.com/store/apps/details?id=com.material.design.codingplanets Scratch : – https://scratch.mit.edu/ What is the best Programming language? There are many types of programming languages; each one has its own purpose, strengths and weaknesses So no language can be the best language for all case. Top programming languages of 2022 معلومات لالطالع فقط number of programming languages that are currently in use is between 250 and 2,500 What Is C#? C# is a modern, general-purpose programming language that can be used to perform a wide range of tasks and objectives that span over a variety of professions. لالطالع فقط: الرسم What is C# used for? Examples for Common uses: 1. Windows applications C# was created by Microsoft for Microsoft, so it’s easy to see why it’s most popularly used for the development of Windows desktop applications. C# applications require the Windows.NET framework in order to function at their best, so the strongest use case for this language is developing applications and programs that are specific to the architecture of the Microsoft platform. 1. C# for Games C# might just be one of the best programming languages for gaming. This language is heavily used to create fan-favorite games like Rimworld on the Unity Game Engine. 1. C# for website development C# is often used to develop professional, dynamic websites on the.NET platform, or open-source software. So, even if you’re not a fan of the Microsoft architecture, you can still use C# to create a fully-functional website. Because this language is object-oriented, it is often utilized to develop websites that are incredibly efficient, easily scalable and a breeze to maintain. multiple versions of visual studio لالطالع فقط https://visualstudio.microsoft.com/downloads/ How To download C#? you can download the free version (community edition from the suitable option to your systems specifications here : 2019 version (recommended for windows 10) : https://apps.microsoft.com/store/detail/visual- studio-community-2019/XP8CDJNZKFM06W or 2022 version (recommended for windows 11) : https://visualstudio.microsoft.com/vs/community/ : روابط فيديو لشرح كيفية تحميل https://www.youtube.com/watch?v=oTVfTudw3Fo https://www.youtube.com/watch?v=nS87SuNa6PM النسخةversion قد تختلف الخطوات حسب: ملحوظة 2022 , 2019, 2017 IDE and Compiler Integrated Development Environment (IDE) IDE is a software that help us to write our code, do a code suggestion, run time, and so on. IDE is a flexible software for us to do some coding because it is have many feature to help us with programming Compiler Compiler job is to translate a high level machine code to lower level programming language. Usually: Write the code on IDE > Compile it > Executable Program ref: https://anlnardo.wordpress.com/2016/09/05/assignment-the-differences-between-ide-and-compiler/ 1.5 Structured Programming In Structured Programming, the code is divided into functions or modules. It is also known as modular programming. Modules or functions are a set of statements which performs a sub task. As each task is a separate module, it is easy for the programmer to test and debug. It is also easy to do modifications without changing the whole program. When changing the code, the programmer has to concentrate only on the specific module. https://medium.com/@floriopotter7/structured-programming- C# language and Java are some examples of assignment-help-abcec6f2509c structured programming languages. 1.6 Unstructured Programming In Unstructured Programming, the code is written as a single whole block. The whole program is taken as a single unit. It is harder to do changes in the program. This paradigm was used in earlier versions of BASIC, COBOL, and FORTRAN. Unstructured programming languages have a limited number of data types like numbers, arrays, and strings. 1.7 Structured versus Unstructured-1 Structured programming languages allow the programmer to divide the whole program into modules or functions and in Unstructured programming, the program is written as one single block. There are differences between structured and unstructured programming in terms of : ○ readability, ○ purpose, ○ complexity, ○ Application, ○ modification, ○ data types, ○ code duplication, ○ and testing. 1.7 Structured versus Unstructured-2 1. Readability. Structured Programming based programs are easy to read. Unstructured Programming based programs are hard to read. 2. Purpose. Structured Programming is to make the code more efficient and easier to understand. Unstructured programming is just to program to solve the problem. It does not create a logical structure. 3. Complexity. Structured Programming is easier because of modules. Unstructured programming is harder when comparing with the structured programming. 4. Application. Structured programming can be used for several scales like: small and medium scale projects. Unstructured programming is not applicable for medium and complex projects. 5. Modification. It is easy to do changes in Structured Programming. It is hard to do modifications in Unstructured Program 6. Data types. Structured programming uses many data types. Unstructured programming has a limited number of data types. 7. Code duplication تكرار. Structured programming avoids code duplication. Unstructured programming can have code duplication. 8. Testing and debugging. اختبار البرنامج لمعرفة أماكن األخطاءIt is easy to do testing and debugging in Structured Programming. It is hard to do testing and debugging in Unstructured programming. 1.8 Algorithms An algorithm is simply a set of steps used to complete a specific task. In addition to being used by technology, a lot of things we do on a daily basis are similar to algorithms. 1.9 Problem Solving Solving problems is the core of computer science. Programmers must first understand how a human solves a problem, then understand how to translate this “algorithm” into something a computer can do, and finally how to “write” the specific syntax (required by a computer) to get the job done. Sometimes, a machine will solve a problem in a completely different way than a human. Example Consider the following example of a problem that needs to be solved: Example- Algorithms In order to develop a program that can solve this problem, we need to think of an algorithm that a human (or a computer) can follow to solve this problem. The following are three candidate algorithms: 1.10 Pseudocode Pseudocode is a plain language description of the steps in an algorithm or another system. Pseudocode often uses structural conventions of a normal programming language, but is intended for human reading rather than machine reading. Example Consider the following example of a Pseudocode describing an algorithm that takes two numbers as inputs, adds them, and provides their sum as output. As shown in the example above, Pseudocode is an English-language like representation of an algorithm. It does not have a standard syntax and can take different forms. It is a compact and informal high-level description of a program. It is not a source code that follows the syntax rules of some programming language. Therefore, it cannot be compiled into a program. 1.11 Flowcharts A flowchart is simply a graphical representation of steps. It shows steps in sequential order and is widely used in presenting the flow of algorithms, workflow or processes. It shows the steps as boxes of various kinds, and their order by connecting them with arrows. Different flowchart shapes have different conventional meanings. Those shapes include terminator, process, decision, and data I/O besides arrows that connect them. Flowchart Symbols name symbole description Terminator The terminator symbol represents the starting or ending point of the system. Process A box indicates some particular operation. Decision A diamond represents a decision or branching point. Lines coming out from the diamond indicates different possible situations, leading to different sub-processes. Data An input might be an order from a customer. Input/Output Output can be a product to be delivered. Arrow Lines represent the flow of the sequence and direction of a process. 1.12 Flowchart Examples The following examples show flowcharts that represent simple programs. 1.12.1 Flowchart Example 1 The following flowchart illustrates the required steps to print the sentence “Hello World” on the screen. 1.12.2 Flowchart Example 2 The following flowchart illustrates the required steps to input two numbers, calculate their sum, and print the result on the screen. 1.12.3 Flowchart Example 3 The following flowchart illustrates the required steps to input the score of a student. Afterward, print “Pass” to the screen if the score is equal to or greater than 50. Otherwise, print “fail” to the screen. Thanks