Binding, Functions and Control Flow - Reading Assignment


#322
  1. An expression is a fragment of code that produces a value.
  2. A binding is a keyword such as var, let, or const, that holds a value and keep them from dissipating.
  3. An environment is the collection of values and bindings that exist at a given time.
  4. Function is a piece of program that is wrapped in a value.
  5. prompt
  6. A side effect are the outputs of function, for example a side effect could be a dialog box or writing text to a screen.
  7. the alert() function will produce a dialog box that will pop up at the top of the screen. the console.log function will keep all side effect inside the console.
  8. Control flow is the order in which programs or statements are executed. From top to bottom.
  9. Conditional executions are codes that are only executed if a certain need or condition is met.
  10. The keyword that is needed to invoke a conditional execution is if()

#323

1.Anything that produces a value is an expression in JavaScript
2.A binding or “variable” holds and catches a value. Binding is assigning values to variables. The keyword “let” defines a binding followed by the name of the binding; in order to give it value we add an operator “=” and an expression
3.The collection of bindings and their values that exist at a given time is called “environment”
4.A function is a set of statements that performs a task or calculate a value; Functions allow you to define code once and use it many times. You can use the same code many times with different arguments to produce different results. A function is defined by the keyword “Function”, followed by a “name”, followed by the parameters (), followed by the body of the function (code) {}
5. Function greeting () {
Console.log (“hello everyone”);
}
6.Showing a dialogue box or writing text to the screen is a “side effect”
7. ?
8. If a program contains multiple functions, the functions are executed from top to bottom
9.If we need our program to execute code if a certain condition holds.
10.We create a conditional execution with the keyword “if”


#324
  1. What is an expression?
    A fragment of code that produces a value is called an expression.
    The simplest fragment is a statement.

  2. What is a binding?
    It is a statement that temporarily holds a value

  3. What is an environment?
    The collection of bindings and their values that exist at a given time is called
    the environment

  4. What is a function?
    A function is a JavaScript procedure—a set of statements that performs a task or calculates a value.It is like a reusable piece of code. You can
    call a function by putting parentheses () after an expression that produces a
    function value. prompt(blahblah); or alert(blah blah). However most functions will contain blocks. that are shown with {} . blocks are a group of statments that should be run together

  5. Give an example of a function.
    loops, count numbers up to 100, pop up windows

let theNumber = Number(prompt(“Pick a number”));
if (!Number.isNaN(theNumber)) {
console.log("Your number is the square root of " +
theNumber * theNumber);
}

  1. What is a side effect?
    Is what happens when you run your code and something happens.
  2. Give an example of a function that produces a side effect and another function that produces a value.
  3. What is control flow?
    Its the direction the program takes when our statements get resolved to true or false.
    let num = Number(prompt(“Pick a number”));
    if (num < 10) {
    console.log(“Small”);
    } else if (num < 100) {
    console.log(“Medium”);
    } else {
    console.log(“Large”);
    }
  4. What is conditional execution?
    only execute the statement or function if something else happens like in the above example
  • Use if to specify a block of code to be executed, if a specified condition is true
  • Use else to specify a block of code to be executed, if the same condition is false
  • Use else if to specify a new condition to test, if the first condition is false
  • Use switch to specify many alternative blocks of code to be executed
  1. What kind of keyword do you need to use to invoke conditional execution?
    if, else, else if, switch

#325
  1. What is an expression?
  • A fragment of code that produces a value is called an expression. Every value that is written literally is an expression.
  1. What is a binding?
  • A special keyword that catches and holds values in the JS console. Bindings do not contain values. They grasp them, so two bindings can refer to the same value.
  1. What is an environment?
  • It’s a collection of bindings and their values that exist at a given time.
  1. What is a function?
  • A function is a piece of program wrapped in a value.
  1. Give an example of a function.
  • Example in the JS console: prompt(“Enter passcode”);
  1. What is a side effect?
  • Changes in a prorgram affecting the world. Also, showing a dialogue box or writing text to the screen is known as a side effect.
  1. Give an example of a function that produces a side effect and another function that produces a value.
  • Ex. of function that produces a side effect: prompt(“Enter you name here”);
  • Ex. of function that produces a value: console.log(Math.min(250, 700) + 200);
  1. What is control flow?
  • A program containing more than one statement and being executed from Top to Bottom.
  1. What is conditional execution?
  • It’s a program taking the proper branch based on the situation at hand. It’s NOT a straight road like the Control Flow is.
  1. What kind of keyword do you need to use to invoke conditional execution?
  • You need to use the “if” keyword.

#326
  1. What is an expression?

A object or variable that is representing a value by a defined name.
I.e.:

int result = 0;
result = 5 +5;

“result” is an expression.

  1. What is a binding?

A variable, a len-type or a constant.

  1. What is an environment?

The current code-space with it’s variables, configuration and behaviour where the programmer is working.

  1. What is a function?

A pre-defined set of actions that can easily executed as standalone or on a object.

  1. Give an example of a function.
    printBig(String inputString) {
    ___String upperCaseString = String.upperCase(inputString);
    ___print(upperCaseString );
    }

  2. What is a side effect?

Lol, what is this question? The line where it is described in the Eloquent makes no sense to me. Side effect is side effect. Beside the main effect - rofl.

  1. Give an example of a function that produces a side effect and another function that produces a value.

// side effect
print(“Hello”);

// value
int myResult = Math.calculate(5 + 6);

  1. What is control flow?

It is a synonym for the flow of the program. The flow can be regulated with, i.e. the If-else-construct, whilst running a application.

  1. What is conditional execution?

It’s only takes action when a certain type of criteria is succeeded. I.e. a While-loop that is executed until specific counter hits a certain value.

// Example
int counter = 0;

While(counter < 10) {
___printf(“Hello”);
___counter++;
}

  1. What kind of keyword do you need to use to invoke conditional execution?

“If”,
“Else-if”,
“else”,
“While” and
“For”


#327

1- A fragment of code which produces a value.
2- Allows you to catch and hold values. For example, name of the binding and creating a value by an operator and expression.
3- The collection of bindings, their values that exist at a given time.
4- A piece of program wrapped in a value
5- prompt(“Enter passcode”)
6- A dialog box or writing text to the screen is known as a side effect when writing a function - Functions also produce values thus, a side effect is not unnecessary to be useful.
7- a) function producing side effect: alert(“blockchain!”)
b) function producing value: console.log ()
8- How the program code follows each other and executed from top to bottom
9- The branch path a program takes when a certain condition is executed.
10- if, else, else/if


#328
  1. is a part of code which give some value
  2. is string conected to some variable that can be used again
  3. is all expresions and bindings written in paticular program
  4. A function is a piece of program wrapped in a value
  5. prompt(“Enter passcode”);
  6. side effect opens a window asking for passcode.
  7. prompt(“Enter passcode”);
    console.log(Math.min(2, 4) + 100);
    8.when your program contains more than one statement, the statements are
    executed as if they are a story, from top to bottom:)
    9.conditional execution is when a code is executed only if a condition fulfilled
    10.if, else

#329

1-What is an expression?
Expression is everything a programmer types in javascript.

2-What is a binding?
Binding is a holder definition that we create for a value. This can be changed anytime later on the program.

3-What is an environment?
Environment is a structural set of programs we are inside at a moment. Like we are in linux or windows or mac, are predefined program structures, which are environments. Javascript is an environment itself also. We can create or change the environment by adding more programs in the calculation.

4-What is a function?
A function is like binding but its not for a value but might be any kind of program piece. A function is a holder definition of a program (might be small or big) we create.

5-Give an example of a function.
function sum2 (a,b) {

return a + b;

};

6-What is a side effect?
Side effect is something that effects and changes the future computations in the program.

7-Give an example of a function that produces a side effect and another function that produces a value.

Console.log (a*b);

True;

8-What is control flow?
Control flow is the order of the statements.

9-What is conditional execution?
It is a control flow with braching roads. The result is variable depending on the input. Can be created with if keyword.

10-What kind of keyword do you need to use to invoke conditional execution?
Can be created with if keyword.


#330
  1. Fragment of code that produces a value is called an expression. Expressions with operators ending with semicolon= statement.
  2. Catch and hold values JavaScript provides a thing called a binding or variable. Value for binding can be changed anytime. Generally bindings don’t contain values, they grasp them. Two bindings can refer to the same value.
  3. The collection of bindings and their values, that exist at a given time is called the environment. eg: browser environment.
    4.Function is a piece of program wrapped in a value. In browser environment, binding prompt holds a function that shows a little dialog box asking for user input.
  4. prompt (“Enter your name”);
    alert (“Time is arrived”);
    var name=“Kini”;
    const greeting= “Hello”;
    console.log ( greeting + name);
    // --> Hello Kini
    6.Showing a dialog box or writing text to the screen is a side effect.
  5. side effect:
    show (" Hello Kini");
    prompt (“Choose between the options”);
    value:
    console.log (2+5);
    // --> 7
    console.log (Math.max(1,5)+6);
    // --> 11
  6. When your program contains more than one statement, the statements are executed as if they are a story and this is control flow. straight-line control flow.
  7. Conditional execution is based on specifying a block of code to be executed if a condition is true or false.

if: is specifying a block of code to be executed if a condition is true.
else: is specifying a block of code to be executed if a condition is false.
else if: lots of information put together to specify a new condition if the first condition is false.


#331

Backend V/S Frontend

  1. Which type of developer programs the code that users interact with directly?
    FrontEnd Program are the program with which Users Interact Directly.

  2. In web-development, what languages does a frontend developer typically use?
    HTML
    CSS
    Javascript

  3. Which type of developer is responsible for making sure the logic of the application runs smoothly?

  4. Which type of developer is responsible for handling databases?
    Backend Developer

  5. Which languages can you use in order to communicate with a database (give 2 examples)?
    MySQL, SQL Server, PostgresSQL, and Oracle


#332

Which type of developer programs the code that users interact with directly?
Frontend

In web-development, what languages does a frontend developer typically use?
HTML, CSS & JS

Which type of developer is responsible for making sure the logic of the application runs smoothly?
Server logic -> Backenddevs.
UI/UX logic -> Frontenddevs.

Which type of developer is responsible for handling databases?
Backend

Which languages can you use in order to communicate with a database (give 2 examples)?
Node, SQL


#333
  1. Which type of developer programs the code that users interact with directly?
    Frontend developers

  2. In web-development, what languages does a frontend developer typically use?
    HTML, CSS, JavaScript

  3. Which type of developer is responsible for making sure the logic of the application runs smoothly?
    Backend developer (for server-related)
    Frontend developer (for user experience)

  4. Which type of developer is responsible for handling databases?
    Backend developer

  5. Which languages can you use in order to communicate with a database (give 2 examples)?
    Ruby, PHP (and bonus 3: Java, .NET, Python)


#334

I got linked here from the blockchain for business course. Broken link.


#335

1- front developer
2- html css java script
3- backed developer
4- backed developer
5- ySQL, SQL, PostgresSQL


#336

The link to toshitimes for the first reading assignment is incorrect. It should have a unique link. It comes to Binding, Functions and Control Flow instead of the specific topic of Backend and Frontend.


#337

Which type of developer programs the code that users interact with directly?

A front-end developer

In web-development, what languages does a frontend developer typically use?

HTML, Java script, CSS

Which type of developer is responsible for making sure the logic of the application runs smoothly?

Back-end developer

Which type of developer is responsible for handling databases?

Back-end developer

Which languages can you use in order to communicate with a database (give 2 examples)?

Python and Java


#338
  1. An expression is a statement or fragment of code that produces a value.
  2. A binding or variable is an object defined to hold value.
  3. An environment is a collection of bindings and their values that exist at a given time.
  4. A function is a piece of program wrapped in a value.
  5. An example of a function is JavaScript’s internal Math.max, that returns the maximum number out of a given set.
  6. A side effect is a change that affects the outside world, like displaying a result on screen, or an internal change of state of the machine in a way that will affect the statements that come after it.
  7. The function Number, that converts an input value after a prompt to a number, is an example of a side effect. The same example I gave in no. 5, Math.max, is a function that produces or returns a value.
  8. Control flow is basically the path in which a program is executed.
  9. Conditional execution is choosing to execute a code if certain condition/s are met.
  10. if, else, else if

#339
  1. Which type of developer programs the code that users interact with directly? Frontend Developer
  2. In web-development, what languages does a frontend developer typically use? HTML, CSS, and JavaScript
  3. Which type of developer is responsible for making sure the logic of the application runs smoothly? Backend Developer
  4. Which type of developer is responsible for handling databases? Backend Developer
  5. Which languages can you use in order to communicate with a database (give 2 examples)? Ruby, Python

#340
  1. code that evaluates to a value.

3)Collection of given variables and their values that exist at a given time.
4)named piece of program with a specific task.
5)console.log
6)code that changes something in the program
7)alert and Math.max
8)top down control flow
9) flow can take two different routes based on a Boolean value
10) if, else


#341
  1. Front-end developer
  2. HTML, CSS & JavaScript
  3. Back-end developer
  4. Back-end developer
  5. Ruby, Python