Programming paradigms means a style, or "way" of programming
1.Compare and contrast declarative and imperative paradigms
Declarative paradigms is a programming paradigm that expresses the logic of a computation without describing its control flow
1.Don't allow side effects
2.Sequence of the steps is not crucial
Declarative paradigms that you know from languages like HTML, XML, CSS, SQL, Prolog, Haskell, F# and Lisp
Imperative paradigms is a programming paradigm that uses statements that change a program’s state
1.Allow side effects
2.Control flow is explicit meaning how the operation took place, stem by step or more naively "First do this then do that". Thus, the order of steps is crucial
Imperative paradigm that you know from languages like C, C++, C#, PHP, Java and of course Assembly.
2.Discuss the difference between procedural programming and functional programming
Procedural Programming:
Procedural programming uses a list of instructions to tell the computer what to do step by step. Procedural programming relies on procedures, also known as routines. A procedure contains a series of computational steps to be carried out. Procedural programming is also referred to as imperative or structured programming
- The output of a routine does not always have a direct correlation with the input.
- Everything is done in a specific order.
- Execution of a routine may have side effects.
- Tends to emphasize implementing solutions in a linear fashion.
Functional Programming:
Functional programming is an approach to problem solving that treats every computation as a mathematical function. The outputs of a function rely only on the values that are provided as input to the function and don't depend on a particular series of steps that precede the function.
- Often recursive.
- Always returns the same output for a given input.
- Order of evaluation is usually undefined.
- Must be stateless. i.e. No operation can have side effects.
- Good fit for parallel execution
- Tends to emphasize a divide and conquer approach.
- May have the feature of Lazy Evaluation.
3.Explain the Lambda calculus an Lambda expressions in functional programming
Functional Programming - Lambda Calculus. Lambda calculus is a framework developed by Alonzo Church in 1930s to study computations with functions.Function creation − Church introduced the notation λx.E to denote a function in which 'x' is a formal argument and 'E' is the functional body
4.What is meant by “no side-effects” and “referential transparency” in functional programming
Referential Transparency
A function that returns always the same result for the same input is called a pure function. A pure function therefore is a function with no observable side effects, if there are any side effects on a function the evaluation could return different results even if we invoke it with the same arguments. We can substitute a pure function with its calculated value, for example
def f(x: Int, y: Int) = x + y
for the input f(2, 2) can be replaced by 4, it is like a big lookup table. We can do so because it does not have any side effects. The ability to replace an expression with its calculated value is called referential transparency
No side-effects
In computer science, a function or expression is said to have a side effect if it modifies some state outside its local environment, that is to say has an observable interaction with the outside world besides returning a value. In functional programming, side effects are rarely used.
5.Discuss the key features of Object Oriented Programming
Encapsulation- Process of wrapping code and data together into a single unit.
For example, a capsule which is mixed of several medicines..
Abstraction- This is focuses on the essential characteristics of some object, relative to the perspective of the viewer
for example, sending SMS where you type the text and send the message. You don't know the internal processing about the message delivery.
Polymorphism- Mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit.
There are two types of polymorphism in Java: compile-time polymorphism and runtime polymorphism. We can perform polymorphism in java by method overloading and method overriding.
Encapsulation- Process of wrapping code and data together into a single unit.
For example, a capsule which is mixed of several medicines..
for example, sending SMS where you type the text and send the message. You don't know the internal processing about the message delivery.
Polymorphism- Mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit.
There are two types of polymorphism in Java: compile-time polymorphism and runtime polymorphism. We can perform polymorphism in java by method overloading and method overriding.
6.How the event-driven programming is different from other programming paradigms?
7.Compare and contrast the Compiled languages, Scripting languages, and Markup languages.
Event-driven programming is a programming paradigm in which the flow of program execution is determined by events
For example a user action such as a mouse click, key press, or a message from the operating system or another program
An event-driven application is designed to detect events as they occur, and then deal with them using an appropriate event-handling procedure.
- Program waits for event
- Whenever something happens the program responds and does something
- A markup language is a language which is used to represent structured data.(xml,html)
- A scripting language is a programming language which is interpreted, rather than compiled, scripting languages represent a subset of all programming languages.(JS,jsp,php)
- A compiled language is a programming language whose implementations are typically compilers (translators that generate machine code from source code), and not interpreters (step-by-step executors of source code, where no pre-runtime translation takes place)(java, c, c++)
8.Discuss the role of the virtual runtime machines.
The virtual machine function is a function for the realization of virtual machine environment. This function enables you to create multiple independent virtual machines on one physical machine by visualizing resources such as the CPU, memory, network and disk that are installed on a physical machine.
9.Find how the JS code is executed (What is the runtime? where do you find the interpreter?)
The source code is passed through a program called a compiler, which translates it into bytecode that the machine understands and can execute. In contrast,JavaScript has no compilation step. Instead, an interpreter in the browser reads over the JavaScript code, interprets each line, and runs it.
10. Explain how the output of an HTML document is rendered, indicating the tools used to display the output
HTML File
<html>
<body>
<h1>My First Heading</h1>
<p> Hello World! </p>
</body>
</html>
<html>
<body>
<h1>My First Heading</h1>
<p> Hello World! </p>
</body>
</html>
Running an HTML File
- Make sure that there is a browser installed on your computer. ...
- Find the saved file. ...
- Right-click (Windows) or double-click (Mac) the file and select "Open with" from the action menu. ...
- View your HTML file in your chosen browser. ...
- Alternate method: Run your browser, then press Ctrl-O
Print in webpage
Hello World!
11.Identify different types of CASE tools, Workbenches, and Environments for different types of software systems (web-based systems, mobile systems, IoT systems, etc.).
Types of CASE tools
Classic CASE tools - established software development support tools (e.g. interactive debuggers, compilers, etc.)
Real CASE tools - can be separated into three different categories, depending on where in the development process they are most involved in:
- Upper - support analysis and design phases
- Lower - support coding phase
- Integrated - also known as I-CASE support analysis, design and coding phases
Environments for different types of
software systems
- The main SDLC environments include:
- The Analysis and Design Environment.
- The Development Environment.
- The Common Build Environment.
- The Testing Environment: This has two components: The Systems Integration Testing Environment. The User Acceptance Testing Environment.
- The Production Environment.
12.Discuss the difference between framework, library, and plugin, giving some examples.
Library
In programming, a library is a collection of precompiled routines that a program can use. The routines, sometimes called modules, are stored in object format.Libraries are particularly useful for storing frequently used routines because you do not need to explicitly link them to every program that uses them
At development time
•Add the library to the project (source code files,
modules, packages, executables, etc.)
•Call the necessary functions/methods using the
given packages/module/classes
At run time
•The library will be called by the code
Framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software. A software framework provides a standard way to build and deploy applications.
At development time
• Create the structure of the application
• Place your code in necessary places
• You may use the given libraries to write your code
• You can include additional libraries and plugins
At run time
• The framework will call your code (inverse ofcontrol)
Environments for different types of software systems
Plugin
In computing, a plug-in (or plugin, add-in, addin, add-on, or addon) is a software component that adds a specific feature to an existing computer program. When a program supports plug-ins, it enables customization.
At development time
•The plugin (source code files, modules, packages, executables, etc.) is placed in the project,
•Apply some configurations using code
At run time
•The plug-in will be invoked via the configurations
No comments:
Post a Comment