1.0 Giving instructions to a computer 1
1.1 Pseudocode 2
1.2 Variables 3
1.2.1 Mathematics operators 4
1.2.2 Output operators 6
1.3 Exercise 1, final grade of university 7
1.4 Actual JavaScript code: 8
1.5, Measure the terrain 9
1.6 Control Flow Statements: 10
2.0 Flow Chart: 11
2.1 Representation of shapes 11
2.2 Loops 13
2.2.1 While condition 13
2.3 Verification Table: 14
2.4 Loop accumulator: 15
2.4.1, do, while, loop statement 15
3.0 For Loop: 17
3.1 What is a for loop: 17
4.0 Arrays 18
4.1 Array Abstraction: 18
5.0 Object Oriented Programming (OOP) 19
5.1 Class 19
5.2 Math Library 19
5.3 Methods statements 23
5.4 Calling and storage a Method. 24
5.4.1 Example, Calculate the BMI with methods: 25
5.5 Scope: 1
5.6 Bubble sorting 1
Grado 12 1
1.0 Two dimensional Array: 1
1.1 Jagged Matrix 1
1.2 The syntax to access an element of 2D and processing 1
1.0 Giving instructions to a computer
Whenever you will give an instruction to the computer, you will have to be really specific within that
instruction, whether is giving a special position/ color/shape/size / etc, the information given to the
computer is always really specific, for example, the following exercise, given the situation I want to
, 2
change the celsius value to a Fahrenheit value, there are a series of specific instructions to this one, for
example, the following.
Input Processing Output
1. Identify the Celcius
value you want to take
into account.
2. Replace the value of
°C within the actual
celsius value in the
Celsius (°C) following formula: Fahrenheit (°F)
9
(°𝐶 · 5 ) + 32 = °𝐹
3. Multiply the value of
9
°C with 5 .
4. Add 32 to that result.
5. The final result will be
the value in °F
1.1 Pseudocode
● Pseudopods: A cell that has the ability to move without some legs, that is what pseudopods
mean, fake or non-existing feet.
Syntax = The way of writing something, this one including different ways depending on the language.
IMPORTANT: Language codes are always included with pseudocode, these ones are not apart.
Example of the pseudocode nation:
Start of an algorithm Algorithm Name Of The Algorithm{
Finish / end of the algorithm }
Data types: Int, float, bool, string, etc:
Primitives Data
Integer number int
Real number (float) Double
Character (single alphabetical number) Char
Boolean data (true/false) Boolean
, 3
Objects Data
String (collection of char) String
If a string, even if this one has any numbers, has a “ “ between these 2, then this one, even if it is a
numeric number, will be considered as a string. (default value of the string is null).
1.2 Variables
The variable is an abstract or real existing field, this one shows how the user wants to show or label
one memory, made to store information or data.
Variables could be changed depending on the operations or modifiers you give in these ones,
obviously depending on the code.
Properties of the variables:
● variables are named with letters (A…Z, a…z) as well as decimal digits of (0...9), including
the underline symbol (_)
● No length limits
● No allowed special symbols (#$%&/(*´¿)
● Variables names are case sensitive (different variables even if these ones are nearly similar)
● Self-documented names.
To store a value to that variable you have to put a “=” sign.
Remember at the end of the code,
more exactly the following:
Name_Of_Variable = Value;
End this one with a semicolon to
specify a sentence separator.
If we to include or input a new data, we have to write first the input of this data, represented with the
simple code input, and then, together with this one, add one of the data types mentioned before:
InputString = Get a string value
InputInt = Get an integer value
, 4
InputDouble = Get a float value
InputChar = get a character value
InputBoolean = get a boolean value
All of this values will indicate a input someone external to the code will put
Default values:
1.2.1 Mathematics operators
Arithmetic operations:
Basic mathematics formulas that show the result of different math equations:
Operators Computes Syntax Category
+ The sum of 2 operands a+b Additive
- Subtract the 1st a-b Additive
operand with the
second operad
* The products of the a*b Multiplicative
operands
/ Divide the first a/b Multiplicative
operand with the
second operand
% The remainder after a%b Multiplicative
dividing the first
operand with the
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller IBHelper. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $8.48. You're not tied to anything after your purchase.