Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Programming J. Holvikivi 2014.

Similar presentations


Presentation on theme: "Software Programming J. Holvikivi 2014."— Presentation transcript:

1 Software Programming J. Holvikivi 2014

2 Basic principle of how a computer works
INPUT OUTPUT Information Data PROCESS

3 What Can Computers Do? Input/Output operations Reads input
Writes output Processing operations Math (computation) Decision making (logic) Photo courtesy of Imation Corporation

4 What Happens Inside Control flow Data flow Instruction flow Control
Unit Arithmetic Logic Unit Data flow Instruction flow Input Unit Output Unit Main memory

5 ALU Arithmetic and Logic Unit
Arithmetic and Logic Unit performs all computations and logical operations 2 + 2 = 4 1 AND 0 is NOT TRUE 2 + 2 < 5

6 Machine instructions Adding values stored in memory
Step 1: Get the value from memory location 6C and place it in a register. =LOAD Step 2: Get the other value to be added from memory location 6D and place it in another register. =LOAD Step 3: Activate the addition circuitry with the registers used in steps 1 and 2 as inputs with another register designated to store the result. =ADD Step 4: Store the result in memory location 6E. =STORE Step 5: Stop. =HALT others: MOVE, OR, AND, ROTATE, JUMP

7 Machine language Code: Step 1: 156C LOAD Step 2: 166D LOAD
Step 3: ADD Step 4: 306E STORE Step 5: C000 HALT

8 Working with a file Memory: RAM Hard disk Processor Save
Device drivers Windows OS Text file MS Word Load to memory MsWord Device drivers and others Text file OS kernel Save Data files Processor

9 Software System software Application software office programs
Operating system GUI Utilities Device drivers networking software Application software office programs graphical software browsers Jaana Holvikivi

10 Programming Languages
Machine Language: 56FC Assembler (mnemonic): ADD Procedural Languages Fortran, Pascal, Python Cobol, BASIC Object-Oriented Languages C ++ Java, C#

11 Programming Languages
Functional languages Prolog, XSLT, Haskell Scripting languages Javascript, php Application development tools .NET Framework Oracle UML tools Natural Languages – not yet

12 Algorithm A sequence of steps that directs the execution of a task
A sheet of music operating instructions for a washing machine instructions for constructing model airplanes Algorithms in computers programs the intelligence required to solve a problem or to perform a task is encoded in the algorithm to follow the directions of an algorithm is "merely mechanical"

13 Program design Start Problem solving Algorithm flow chart pseudo code
Source code Compiler Interpreter Executable program in machine language Instructions in machine language End

14 Programming language features
Data types Constants Variables Expressions Operators Statements: conditional, loops Functions Objects Methods Events Jaana Holvikivi

15 Scratch: Computational Concepts
Description sequence identifying a series of steps for a task loops running the same sequence multiple times parallelism making things happen at the same time events one thing causing another thing to happen conditionals making decisions based on conditions operators support for mathematical and logical expressions data storing, retrieving, and updating values Jaana Holvikivi

16 Scratch: Computational Practices
Description being iterative and incremental developing a little bit, then trying it out, then developing some more testing and debugging making sure that things work – and finding and fixing mistakes reusing and remixing making something by building on what others – or you – have done abstracting and modularizing building something large by putting together collections of smaller parts Jaana Holvikivi

17 Features in Scratch Jaana Holvikivi

18 Operators Assignment Operators + addition - Subtraction * Multiplication / Division % remainder Comparison Operators, true or false == is equal to != is not equal 5!=8 returns true < less than > Greater than >= Greater than or equal <= less than or equal Jaana Holvikivi

19 Operators RESULT Logical Operators && AND || OR ! NOT AND 1 OR NOT
1 OR NOT Jaana Holvikivi

20 Conditional statements
Jaana Holvikivi

21 Loops Wait Repeat Forever Expressions Jaana Holvikivi

22 First Steps in programming
use sequence, selection, and repetition in programs and various forms of input and output & variables

23 Effective Saving Strategies
Your Responsibility To Save And Backup Frequently. Save Every 5 Minutes Change Filename Every 15 Minutes No Auto Saves On Most Developer Software

24 Task 1 Go to Scratch home page, and Join Scratch.
You need to create an account in order to be able to save your work. Use some other ID and password than in Metropolia systems. Go through the basics of project creation selecting Try it out or holiday card: Jaana Holvikivi

25 Task 2 Explore projects that are posted on the Scratch site.
Try different types of projects! Choose one interesting project and try to understand its functioning. Show the project to your team and explain it. Jaana Holvikivi

26 Task 3 Explore different features Scripts, Costumes and Sounds. Try different types of projects, see what is available for modification! Select some very serious science or mathematics project for modification, such as fractals or operating systems. Finally, create a project where you can ask your classmates to join. Jaana Holvikivi


Download ppt "Software Programming J. Holvikivi 2014."

Similar presentations


Ads by Google