Fundamentals of C++ Programming - 00: CourseIntroduction - Dustin Nguyen, PhD

Audience: students who have no background in computer programming
❖ Aims: provide basic knowledge and skill on programming with two important programming
paradigms: structure programming and object-oriented programming.
❖ Demonstration language: C++
❖ Prerequisite: basic math knowledge
❖ Requirement:
❖ Class attendance
❖ Self-study
❖ Work hard 
pdf 34 trang xuanthi 27/12/2022 2840
Bạn đang xem 20 trang mẫu của tài liệu "Fundamentals of C++ Programming - 00: CourseIntroduction - Dustin Nguyen, PhD", để tải tài liệu gốc về máy hãy click vào nút Download ở trên.

File đính kèm:

  • pdffundamentals_of_c_programming_00_courseintroduction_dustin_n.pdf

Nội dung text: Fundamentals of C++ Programming - 00: CourseIntroduction - Dustin Nguyen, PhD

  1. Introduction ❖ Audience: students who have no background in computer programming ❖ Aims: provide basic knowledge and skill on programming with two important programming paradigms: structure programming and object-oriented programming. ❖ Demonstration language: C++ ❖ Prerequisite: basic math knowledge ❖ Requirement: ❖ Class attendance ❖ Self-study ❖ Work hard 2
  2. Syllabus ❖ Course meeting time: ❖ Lecture: 3 hours/week for 15 weeks ❖ Laboratory: 30 hours ❖ Course mechanics: ❖ Textbook: C++ How to program ❖ Reference book: Fundamentals of C++ Programming – Richard L.Halterman ❖ Lecture notes 4
  3. Today’s outline ❖ Hardware vs. Software ❖ Programming language ❖ Problem solving and software development ❖ Algorithm ❖ Discussion 6
  4. Computer Architecture ❖ von Neumann architecture [source: Wikipedia] 8
  5. Software ❖ Definition: A set of machine-readable instructions that directs a computer's processor to perform specific operations. [Wikipedia] ❖ Software vs. Program ❖ At the lowest level, executable code consists of machine language instructions specific to an individual processor. ❖ At the high level, programs are built from source code using development tools (also software) ❖ There are programmers who wrote tools to help other programmers and the other who used to solve problems. 10
  6. Programming language [source: lifehacker] 12
  7. Programming language ❖ Which language should you choose? ❖ What is your need? What is your programming style? ❖ Why C/C++? ❖ The language that places a foundation for many others ❖ Gain high-level programming skills ❖ Freedom, flexibility, advanced techniques, 14
  8. Programming language ❖ The process of building a computer program Enhanced Object code source code Executable Editor Preprocessor Compiler Linker program Problem solution, Library declaration Libraries design of program (source code) (object code) 16
  9. Problem solving strategies solution Plan Act method criteria known apply to new situations Define Gather Explore Check Generalize problem information constraints unknown make sense look at the evaluate troubleshooting Disseminate problem from brainstorm against different criteria viewpoint 18 Don Woods & Philip Wankat
  10. Problem solving ❖ Two basic approaches ❖ Iterative: solve a part of the problem, repeat the process on the remaining problem until the original problem is solved ❖ Recursive: define how to solve simplest problems. Then we break the problem into simpler and simpler pieces until they reach the level that computer know how to solve (by our definition). 20
  11. Software development ❖ Address your problem, collect requirements ❖ Analyse feasible approaches, find solution ❖ Design algorithm ❖ Implement: write code ❖ Compile, debug ❖ Evaluate the program ❖ Deploy software 22
  12. Algorithm ❖ Algorithm is a self-contained list of operations to be performed. ❖ An algorithm is an effective method that can be expressed within a finite amount of space and time and in a well-defined formal language for calculating a function. ❖ Describe algorithm ❖ Text: details of data flow and processing steps ❖ Pseudo code ❖ Flowchart 24
  13. Algorithm ❖ Pseudo code - guideline ❖ Mimic good code and natural language ❖ Ignore unnecessary details ❖ Don’t belabour the obvious ❖ Take advantage of programming shorthands ❖ Consider context ❖ Don’t lose sign of the underlying model ❖ Check for balance 26
  14. Algorithm ❖ Flow chart ❖ A type of diagram that represents the algorithm (in our context). The flow chart illustrates a solution model to a given problem. ❖ A flow chart is constructed from basic shapes that have specific meanings. 28
  15. Algorithm ❖ Flowchart ❖ Flow line: represents control pass from one symbol to another. ❖ On-page connector: has more than one arrow coming into it but only one going out. It is useful to represent iterative processes. ❖ Annotation: represents comments or remarks about the flowchart. ❖ Terminal: usually has word/phrase to indicate the start/end of a process. ❖ Decision: where the decision must be made (usually Y/N). 30
  16. Algorithm Start ❖ Flowchart - example Input A, B INPUT A,B N Loop while B > 0 B > 0 If A > B then Y A = A - B Y Else A > B A = A - B B = B - A N End End loop B = B - A Print A Print A End 32
  17. Homework ❖ Describe two or three problems in practice that should be solved by software. ❖ Analyse your problem following the process in this lecture. ❖ Write pseudocode to represent your algorithm. ❖ Draw flowchart to represent your algorithm. 34