Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Concept Chapter I Introduction to Java Programming.

Similar presentations


Presentation on theme: "Programming Concept Chapter I Introduction to Java Programming."— Presentation transcript:

1 Programming Concept Chapter I Introduction to Java Programming

2 By the end of this lecture you should be able to: explain how the module is structured; prepare adequately for lectures, tutorials and practicals; explain how the module is assessed; explain the meaning of the word software; explain how Java programs are compiled and run; use an integrated development environment (IDE) to write, compile and run programs.

3 Unit Lectures : Ematchandirane Vasu St-Patrick’s college, London Email : ematchandirane.vasu@st-patricks.ac.uk

4 MODULE FORMAT

5 2.5 HOUR LECTURE 1 HOUR TUTORIAL 1.5 HOURS COMPUTER LAB

6 Preparing for your lectures, tutorials and practicals

7 ASSESSMENT

8 Assignment (Coursework)-week 12 Portfolio 1-Week 4 Portfolio 2-Week 7 Portfolio 3-Week 10

9 public class Game { Car f1; f1.spin(); } The set of instructions that tells a computer what to do is called a program

10 public class Game { Car f1; f1.spin(); } Software is the name given to a single program or a set of programs.

11 Application software is the name given to useful programs that a user might need.

12 System software is the name given to special programs that help the computer to do its job.

13 public class Game { Car f1; f1.spin(); } Programming is the task of writing instructions for the computer

14 public class Game { Car f1; f1.spin(); } These instructions have to be written in a special programming language.

15 public class Game { Car f1; f1.spin(); } Examples include: C++, Visual Basic, Pascal, Java.

16 public class Game { Car f1; f1.spin(); } Examples include: C++, Visual Basic, Pascal, Java.

17 Compiling Programs

18 COMPILER if (words > MAX) { System.out.print(); } program (source) code 00111110 11010010 11110010 01010110 machine code Programmer Program user

19 Java Programming

20 JAVA COMPILER if (words > MAX) {System.out.print(); } program code JVM Java byte code 11110011 00001101 01010111 10000101 Java Programmer 00111110 11010010 11110010 01010110 10011001 00011111 01010111 11100000 01100011 11111000 10101100 10001001

21 Java Applications

22 A console application

23 A graphical application

24 A Java Applet running in a browser

25 A Java application running on a mobile phone

26 A Java application running on a smart phone

27 Your first program

28 public class Hello { public static void main(String[ ] args) { System.out.println("Hello world"); } }

29 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World

30 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public static void main(String[ ] args) { } System.out.println("Hello world");

31

32 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public Static void main(String[ ] args) { System.out.println("Hello world");

33 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public Static void main(String[ ] args) { System.out.println("Hello world");

34 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public Static void main(String[ ] args) { System.out.println("Hello world");

35 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public static void main(String[ ] args) { System.out.println("Hello world");

36 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public static void main(String[ ] args) { System.out.println("Hello world");

37 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public static void main(String[ ] args) { } System.out.println("Hello world");

38 public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } Hello World public class Hello { } public static void main(String[ ] args) { } System.out.println("Hello world");

39 Integrated development environment (IDE)

40

41 Type your programs here

42 Use these icons to compile and run you program

43 Compiler errors reported here

44 Your files shown here

45

46 Compiling and Running Java from TextPad 46 TextPad Optional

47 Compiling and Running Java from JBuilder 47 JBuilder Optional

48 Compiling and Running Java from NetBeans 48 NetBean s Optional

49 A Programming Puzzle

50

51 CREATE data

52 DISPLAY data

53 CREATE data PUT value IN data DISPLAY data

54 CREATE data PUT value IN data DISPLAY data ADD value TO data

55 CREATE data PUT value IN data DISPLAY data ADD value TO data 3 x 6 = ?

56 CREATE data PUT value IN data DISPLAY data CREATE data ADD value TO data

57 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data

58 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data total

59 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data total PUT value IN data

60 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data total PUT 6 IN total

61 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 6 total

62 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 6 total ADD value TO data

63 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 6 total ADD 6 TO total

64 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 12 total ADD 6 TO total

65 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 12 total ADD 6 TO total ADD value TO data

66 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 12 total ADD 6 TO total

67 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 18 total ADD 6 TO total

68 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 18 total ADD 6 TO total DISPLAY data

69 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 18 total ADD 6 TO total DISPLAY total

70 CREATE data PUT value IN data DISPLAY data CREATE total ADD value TO data PUT 6 IN total 18 total ADD 6 TO total DISPLAY total 18

71 CREATE total PUT 6 IN total ADD 6 TO total DISPLAY total

72 CREATE total PUT 6 IN total ADD 6 TO total DISPLAY total Create data

73 CREATE total PUT 6 IN total ADD 6 TO total DISPLAY total Input data

74 CREATE total PUT 6 IN total ADD 6 TO total DISPLAY total Process data

75 CREATE total PUT 6 IN total ADD 6 TO total DISPLAY total Output data

76 CREATE total PUT 6 IN total ADD 6 TO total DISPLAY total

77


Download ppt "Programming Concept Chapter I Introduction to Java Programming."

Similar presentations


Ads by Google