foundations of programming and problem solving introduction
TRANSCRIPT
![Page 1: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/1.jpg)
Foundations of Programming and Problem Solving
Introduction
![Page 2: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/2.jpg)
Outlines– Course overview– Teaching style– Assessment– Course information and support– About me– About you– What is a computer programming language?– Different programming languages– Machine code– Assembler– C– Java– PHP– Python
– What is Java?
![Page 3: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/3.jpg)
Course overview
At the end of this course, you will be able to:• Write, compile, debug, test and execute computer
programs using Java• Use variables to store a program's state• Process numbers with arithmetic operators• Use loops and logic to control a program• Define methods which process data• I Define classes and use objects(may be!)
![Page 4: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/4.jpg)
Teaching style
• Lectures (2 hours)• Labs (2 hours)
![Page 5: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/5.jpg)
Assessment
• Programming assignment 1: 15%• Programming assignment 2: 15%• Programming assignment 3: 15%• Presentation: 10%• Problem solving assignment: 15%• Exam 30%
![Page 6: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/6.jpg)
Course information and support
• Office hours (Monday 11am-12pm) • Course material:• http://www.doc.gold.ac.uk/~mas01lo/course/2012-2013/foundation/lectures.html
• Or learn.gold• The problem solving part will be in learn.gold
![Page 7: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/7.jpg)
About me
• Lahcen Ouarbya• Room 6, 29 st-james• Email: [email protected]• Website: www.doc.gold.ac.uk/~mas01lo• Tel: 020 7717 2263
![Page 8: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/8.jpg)
About you
Turn to the person next to you and ask each other the following questions:
• Have you used a computer program before?• Which ones (name 2)?• Which problem(s) did you solve with the program?• What type of information did you work with?• What is a computer program?• Now tell the class what your partner said
![Page 9: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/9.jpg)
What is a computer programming language?
Again, in the same pairs, answer these questions:
• Name a computer programming language• Have you used a computer programming language
before?• which ones?• What have you used them for?• What is a computer programming language?• Now tell the class what your partner said
![Page 10: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/10.jpg)
Different programming languages
• Machine code• Assembler• C• Java• PHP• Python
![Page 11: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/11.jpg)
Machine code
![Page 12: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/12.jpg)
Assembler
Add $r1, $r2, $r3Sub $r3, $r4, $r5
![Page 13: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/13.jpg)
C
#include <stdio.h>main(){printf(Hello world!\\n);}
![Page 14: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/14.jpg)
Java
class Test { static void main() { System.out.println(Hello world); } }
![Page 15: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/15.jpg)
PHP
<? echo ("Hello world!");?>
![Page 16: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/16.jpg)
Phyton
print("Hello world!")
![Page 17: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/17.jpg)
Java
• An object orientated programming language• A high level, human readable language• A cross platform language• 'Write once, run anywhere'
![Page 18: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/18.jpg)
18
Software Development Tools• We will use a combination of the Dr Java IDE and
the Sun Java SDK
SourceFile(s)(.java)
Programmer
Dr Java IDE
Compiler(javac)
ClassFile(s)(.class)
VirtualMachine
(java)
Edit Build Run
Programexecutes
Parts of Sun Java SDK
Graphical User Interface
![Page 19: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/19.jpg)
19
Program Development Steps
Edit and save source code
Build source codeto create program
Run program andevaluate results
Errors
Errors
• Classical “Waterfall” Development Steps
![Page 20: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/20.jpg)
20
Styles of User Interface
• Graphical User Interface (GUI)– Computer displays a combination of text and
graphical symbols offering options to the user– User manipulates mouse and uses keyboard to
select from the offered options (“hot keys”) or to enter text
– More common now (computer power is cheap)– Considered by most to be “user friendly”– Examples: M/S Windows/Office or MAC O/S
![Page 21: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/21.jpg)
21
Software Development Tools• Using Sun Java SDK alone
SourceFile(s)(.java)
Programmer
Compiler(javac)
ClassFile(s)(.class)
VirtualMachine
(java)
Editor
Programexecutes
Parts of Sun Java SDK
Command Line Interface
![Page 22: Foundations of Programming and Problem Solving Introduction](https://reader034.vdocuments.net/reader034/viewer/2022051400/56649b56550346318e8d51f9/html5/thumbnails/22.jpg)
First Java ProgramHelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
}