tailieunhanh - Lecture Visual programming: Chapter 7 - Muhammad Bilal Zafar

This chapter presents the following content: DF traversal, parsing, top down parsing, predictive parsing, e-productions, designing a predictive parser, left recursion. | LESSON 07 Overview of Previous Lesson(s) Over View C++ Keywords Reserved words Identifiers Programmers defined variables Variables A named storage location in the computer’s memory for holding a piece of data. Data Types Looping structures Decision structures For loop If While If / else Do While Switch 3 Over View Operator Precedence Operator precedence orders the operators in a priority sequence. In an expression with more than one operator, evaluate in this order: - (unary negation), in order, left to right * / %, in order, left to right + -, in order, left to right Example expression 2 + 2 * 2 – 2 4 evaluate first evaluate second evaluate third Over View Type Conversion and Casting Implicit type conversion: When an expression involving variables of different types then for each operation to be performed, the compiler has to arrange to convert the type of one of the operands to match that of the other. Explicit Type Conversion: A forced conversion from one type to another is referred as explicit type conversion. Auto keyword is used as the type of a variable in a definition statement and have its type deduced from the initial value. auto n = 16; // Type is int auto pi = ; // Type is double 5 Over View 6 Scope Over View Namespaces provide a way to separate the names used in one part of a program from those used in another. namespace keyword is used to declare a namespace namespace myStuff { // Code that I want to have in the namespace myStuff. } This defines a namespace with the name myStuff . 7 Over View Structures A structure is a collection of simple variables. The data items in a structure are called the members of the structure. 8 Over View 9 Enumeration: To cope the need for variables that have a limited set of possible values. An enum declaration defines the set of all names that will be permissible values of the type, are called enumerators. Ex, It can be usefully referred to by labels the days of the week or months of the year. enum . | LESSON 07 Overview of Previous Lesson(s) Over View C++ Keywords Reserved words Identifiers Programmers defined variables Variables A named storage location in the computer’s memory for holding a piece of data. Data Types Looping structures Decision structures For loop If While If / else Do While Switch 3 Over View Operator Precedence Operator precedence orders the operators in a priority sequence. In an expression with more than one operator, evaluate in this order: - (unary negation), in order, left to right * / %, in order, left to right + -, in order, left to right Example expression 2 + 2 * 2 – 2 4 evaluate first evaluate second evaluate third Over View Type Conversion and Casting Implicit type conversion: When an expression involving variables of different types then for each operation to be performed, the compiler has to arrange to convert the type of one of the operands to match that of the other. Explicit Type Conversion: A forced conversion from one type to another is .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.