CSE 240 Final Review With 100% Correct Answers
Logic - ANSWER - based on formal logic and includes logic predicates for computation Functional - ANSWER - use of mathematical functions (based on Lambda Calculus) to express computation, simpler because of use of expressions Procedural/Imperative - ANSWER - processing actions one step at a time using variables and conditional statements Object Oriented - ANSWER - based on concept of objects and classes, pillars of OOP (Encapsulation, Abstraction, Inheritance and Polymorphism) Example of Logic Paradigm - ANSWER - Prolog Example of Functional Paradigm - ANSWER - Lisp Example of Procedural/Imperative Paradigm - ANSWER - C/C++ Example of Object Oriented Paradigm - ANSWER - Java, C++ Strongly typed langauges - ANSWER - Java, C++ Weakly typed languages - ANSWER - Prolog Compilation Stage - ANSWER - converts the code into machine code (creates an exe) before the program runs Interpretation Stage - ANSWER - converts code into machine code while the code is running How compiler works - ANSWER - source code - compiler - machine code - output How interpreter works - ANSWER - source code - interpreter - output Example of semantic error - ANSWER - Forgetting to divide by 100 when printing a percentage amount Example of semantic error - ANSWER - parameters not matching in function declaration and function call Semantic Errors - ANSWER - meaning error; things that don't make sense but do not violate lexical or syntactic rules Lexical Errors - ANSWER - tokens; spelling errors; variable names that start with numbers, numbers that have more than one decimal point, etc. Syntactic Errors - ANSWER - things that are supposed to follow but do not follow; grammar errors in a sentence Size of int - ANSWER - 4 bytes Size of array of ints - ANSWER - 4 * number of indices in array declaration
Written for
- Institution
- CSE 240
- Course
- CSE 240
Document information
- Uploaded on
- May 1, 2024
- Number of pages
- 3
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
logic answer based on formal logic and inc
Also available in package deal