Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fundamentals of Software Development 1Slide 1 Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote your first.

Similar presentations


Presentation on theme: "Fundamentals of Software Development 1Slide 1 Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote your first."— Presentation transcript:

1 Fundamentals of Software Development 1Slide 1 Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote your first lines of code in this course in WordGames. Why start with such a complex project?Why start with such a complex project? Answer:Answer: –It is practical to do so, by using an interface to connect your code to ours –It makes the point that most software engineers modify/extend existing programs rather than creating their own “from scratch” See next slides for details on these two points

2 Fundamentals of Software Development 1Slide 2 UML class diagram for WordGames CapitalizerNameDropperxxx … StringTransformable --------------------------- transform(String) : String All our stuff The StringTransformable interface is how our code knows how to “connect” to your code Questions on this important idea?

3 Fundamentals of Software Development 1Slide 3 “From scratch” projects Today’s software engineering is almost NEVER “from scratch”Today’s software engineering is almost NEVER “from scratch” –Compilers translate from high-level language to machine code –We use libraries for printing and (in Java) much more –We reuse existing code During a 20 year career, a typical software engineer might:During a 20 year career, a typical software engineer might: –Work on about 20 projects –Be involved with the creation of only 1 or 2 projects from scratch For all the other projects, she modifies/extends existing projectsFor all the other projects, she modifies/extends existing projects We’ll do a “from scratch” project today called HelloWorldWe’ll do a “from scratch” project today called HelloWorld –So that you can see what one is like –And so that you can see “under the hood” of some of the concepts that you have been studying

4 Fundamentals of Software Development 1Slide 4 Hello World concepts – outline The next slide shows the entire HelloWorld programThe next slide shows the entire HelloWorld program –It illustrates the following concepts: The main methodThe main method Static methodsStatic methods Console projectsConsole projects How to use System.out.println to print a String to the consoleHow to use System.out.println to print a String to the console –You will experience these same concepts in your own HelloWorld project immediately afterwards So pay attention and ask questions!So pay attention and ask questions!

5 Fundamentals of Software Development 1Slide 5 Hello World – the complete program public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world"); } main is the name of the special method at which any Java application begins A static method is a method that “belongs” to the class instead of to each instance of the class. The static method cannot refer to the class’ non-static fields. The special main method is, by definition, static. System is a class that has “system” stuff System has a public static field called out that is a PrintStream – a thing that can print to the console main has command-line arguments sent as a String array println is a PrintStream method that prints its argument on a line Instructor: run this zipped HelloWorld project HelloWorld project

6 Fundamentals of Software Development 1Slide 6 Hello World – the complete program public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world"); } What is special about the main method? The main method is static. What does that mean? Is System a class, method or field? How can you tell? Is out a method or field? How can you tell? Is println a method or field? What does println do? Find a partner with whom you would like to do the HelloWorld project. With that partner, answer the questions below. Ask for help as needed from your instructor or assistants! Once you are satisfied that you understand the HelloWorld program shown below, do the HelloWorld, Part 1 project with your partner.HelloWorld, Part 1


Download ppt "Fundamentals of Software Development 1Slide 1 Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote your first."

Similar presentations


Ads by Google