Tuesday 6 October 2015

Data Types

What I have learnt so far

The data types I have learnt about are:

Real - a decimal value such as 3.27
Integer - a whole number/value such as 11
Boolean - 2 values, either false or true
String - stores a string of character

Questions on data types

1)
 a)
FlowerType
Example: AGTRO
Type: String
Size: 5 bytes
b)
PricePaid
Example: 4.50
Type: Real
Size: 4-8 bytes
c)
SalePrice
Example: 6.75
Type: Real
Size: 4-8 bytes
d)
QuantitySold
Example: 23
Type: Integer
Size: 2-4 bytes
e)
OutOfStock?
Example: False
Type: Boolean
Size: 1 bit

2)
In Python:
Integer: Int
Real:
Boolean:
String:

Wednesday 23 September 2015

Pseudo Code

Pseudo Code

What is it?

Pseudo code is the general language to convert algorithms to a coding language.
It has set words for everything you want it to do.
For example:
INPUT OUTPUT IF/ELIF/ELSE WHILE/ENDWHILE FOR/NEXT
Here is a video to explain what they do:

Tuesday 15 September 2015

Algorithms Flowcharts

Flowcharts

The Shapes

There are 4 basic flowchart shapes:


1. The Terminator - This shape is used to start or stop the flowchart
2. The Decision - This shape is used to allow the user to make a decision (e.g. do you like pancakes? Yes or No)
3. Input/output - This shape is used to either allow the user to input something (e.g. a value) or display something to the user (e.g. an image)
4. Process - This is used to tell the computer to do something (e.g. a sum)

>


Flowchart Questions

1. Calculate the area of a triangle from dimensions input by the user
2. Ask the user to input the value for the radius of a circle and then ask them to choose either circumference or area and output the chosen value.