1 / 33

Introduction to Java Programming: Algorithms and Tools

This course introduces students to Java programming, algorithms, and essential tools such as BlueJ and Owl. Students will learn basic syntax, compile and run programs, and create algorithms.

tritt
Download Presentation

Introduction to Java Programming: Algorithms and Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 211 Java I Algorithmic thinking

  2. Today’s plan • Administrivia • Roster • Course web site • Syllabus • Course tools • Each other • Classroom presenter (next week) • Tablets • OWL • BlueJ • What is an algorithm? • Your first cup of Java • Create a simple program • Compile and run • Using BlueJ • Using TextPad • Deliverables • Your algorithm • Several drawings • Your first program • All in a Word file

  3. Basic links • Class web site - https://col.cdm.depaul.edu(CampusConnect userID and password) • Textbook – “Java Programming: From Problem Analysis to Program Design” (3rd Edition), by D.S. Malik along with OWL • Syllabus http://facweb.cs.depaul.edu/asettle/csc211tablet/info/syllabus.htm

  4. Today’s plan • Administrivia • Roster • Course web site • Syllabus • Course tools • Each other • Tablets • BlueJ • OWL • Classroom presenter (next week) • What is an algorithm? • Your first cup of Java • Create a simple program • Compile and run • Using BlueJ • Using TextPad • Deliverables • Your algorithm • Several drawings • Your first program • All in a Word file

  5. Introductions • Name • Major (including grad or undergrad) • Previous programming experience (if any) • Something everyone should know about you

  6. Course tools Each other (no kidding!) Classroom Presenter (introduced next week) Tablets Flash drive OWL Java 6 JDK/SDK BlueJ (or another IDE)

  7. Exercises • Meant to help you understand the concepts as they are presented to you • You must work with another classmate • There are not enough computers for everyone in the class • Physically move the chairs so you face each others and work out a solution • We will discuss solutions as a group

  8. Group Exercises Some activities will require larger groups You must work with your daily partner and another pair of classmates Physically move the chairs so you face each others and work out a solution We will discuss solutions as a group

  9. Who’s with me? Instructor side: A check on how well students in the class have understood a point Student side: A check on how many in the class share your understanding of a point A questions will be posted on the PPT or white board In Classroom Presenter you need to enter your answer (multiple choice, text, hand drawing) Instructor will show one or more answers to the class We will learn how to do this starting next week

  10. Meeting point The lab exercises contain several self-paced activities meant to help you discover the various concepts we present When you see a Meeting Point divert your attention back to the instructor and the rest of the class We will discuss possible solutions together or go over some lecture material

  11. Tablets policies Partner up – Identify a partner you will work with during the class (either ahead of time or when you arrive at class) Check in – Before the start of class pick up one laptop from the cart, unplug it and replace it with your or your partner’s ID Clean up – At the end of class copy all files you and your partner create on your and your partner’s flash drive and delete them from the laptop Check out – Return the tablet to the cart slot with your or your partner’s ID and plug it in Do this NOW

  12. More about OWL • This online service will be helpful for you to practice basic syntax as we go through the material in class • The system gives you exercises to do and offers immediate feedback • You can go back as many times as you want to try to complete the exercises • Each week you will have a number of OWL exercises to complete

  13. More on OWL • To access OWL: http://owl.course.com/ • You will need to use a code that can be purchased online at the OWL site • The system will ask you for your email address and will let you set your password • Registration on the system will be your first OWL exercise • See the Useful Links for a tutorial about accessing OWL

  14. The JDK/SDK environment • To be able to run Java programs you need the Java Development Kit (JDK), also called Software Development Kit (SDK) installed on your machine • Download JDK 1.6.11 to the C: drivehttp://java.sun.com/javase/downloads/index.jsp • You need the full SDK not just the JRE (Java Runtime Environment)

  15. The JDK/SDK environment • Once you have installed the SDK you may need to set the PATH and CLASSPATH (environment) variables • If you have a Mac OS X jaguar, the SDK should be installed by default • See the Useful Links for tutorials on installing Java and setting environment variables

  16. From JDK to Java programs The JDK/SDK contains the essential elements to use the Java language You will need a text editor to write the Java programs that contain the instruction to be executed by the machine The instructions are validated by the java compiler (part of the JDK)

  17. IDEs • Many products were created to ease the interaction of the user with the JDK, they are called Integrated Development Environments (IDEs) • They contain a smart editor and other tools for debugging, compiling, and running your program • The IDE we will primarily use is BlueJ

  18. BlueJ BlueJ is already installed on the tablets and all labs in CDM BlueJ is available for download at: http://www.bluej.org/download/download.html We’ll start using BlueJ in class today

  19. Today’s plan • Administrivia • Roster • Course web site • Syllabus • Course tools • Each other • Classroom presenter (next week) • Tablets • OWL • BlueJ • What is an algorithm? • Your first cup of Java • Create a simple program • Compile and run • Using BlueJ • Using TextPad • Deliverables • Your algorithm • Several drawings • Your first program • All in a Word file

  20. Group Exercise Complete Part 1 of Lab 1 by: • Identifying another partner pair to work with and moving the chairs so you face each other • For this exercises you need to select: • One note taker • One time keeper • One “compiler” who needs to leave the room • Following the instructions in the CSC211_L1.doc handout • I will call time for the various parts as we go • Be prepared to discuss your solution with the rest of the class • Finish Part 1 of Lab 1 by cutting and pasting your algorithm and the resulting drawing into your documents

  21. Group Exercise – My dream house

  22. Algorithms and Java programs • An algorithm is a set of precise instructions intended to solve a specific problem • A computer program is an algorithm written in a “language” that a computer can understand and execute • The Java language specifies the words and symbols that we can use and a set of rules that dictate how the words and symbols can be put together to form a valid statement

  23. You Program is a solution to a problem • Understand the problem • Break it down • Come up with a solution • Consider alternative solutions • Write down all the pieces needed to implement your solution • Specify how all the pieces interact with one another • (using English or, better, pseudocode, “Jenglish”) • Translate the set of instructions (algorithm) using a • programming language (Java in our case)

  24. Today’s plan • Administrivia • Roster • Course web site • Syllabus • Course tools • Each other • Classroom presenter (next week) • Tablets • OWL • BlueJ • What is an algorithm? • Your first cup of Java • Create a simple program • Compile and run • Using BlueJ • Using TextPad • Deliverables • Your algorithm • Several drawings • Your first program • All in a Word file

  25. Another lab exercise • Complete Part 2 of Lab 1 • This is a regular exercise to be completed by you and your partner • Read the instructions in the file CSC 211_L1.doc that you downloaded from the COL site

  26. And yet another lab exercise Now complete Part 3 of Lab 1 with your partner by: • Opening the project Picture from the Week 1 materials you downloaded from COL • Compiling the PictureDriver.java class • Right-clicking on the compiled class • Calling the kick-off method: main • Pasting the resulting picture into your document

  27. Processing programs • A program must be translated into machine language before it can be executed on a particular type of CPU • A compiler is a software tool which translates source code into a specific target language • Often, that target language is the machine language for a particular CPU type • The Java approach is somewhat different

  28. The Java compilation process • The Java compiler first translates Java source code into a special representation called bytecode • The java source code is contained in ordinary text files, saved with the extension.java • The compiler produces byte code in a .classfile • We will learn how to compile (and run) java programs in two different ways: • The low-level way, with no IDE • Using an IDE such as BlueJ

  29. Java Translation and Execution • Java byte code is not the machine language for any traditional CPU • It is language for the so called Java Virtual Machine • Another software tool, called an interpreter, makes the JVM talk to specific processors, translating bytecode into machine language and executing it • Therefore the Java compiler is not tied to any particular machine • Java is considered to be architecture-neutral

  30. Java bytecode Java Translation and Execution Java source code PictureDriver.java PictureDriver.class Java compiler Java interpreter Execution Machine code

  31. The final lab exercise Complete Part 4 of Lab 1 with your partner by: • Determining how to modify the previous picture • Changing the algorithm to include the new element • Modifying the PictureDriver class to include statements implementing your algorithm • Pasting the code you added into your document • Pasting the resulting picture into your document

  32. Today’s plan • Administrivia • Roster • Course web site • Syllabus • Course tools • Each other • Classroom presenter (next week) • Tablets • OWL • BlueJ • What is an algorithm? • Your first cup of Java • Create a simple program • Compile and run • Using BlueJ • Using TextPad • Deliverables • Your algorithm • Several drawings • Your first program • All in a Word file

  33. Submitting the lab • Put you and your partner’s name at the top of the lab document • Each person should keep a copy of the document • Upload the .docx file to Assignments/Lab 1 on the COL site • Only one of you and your partner should do this

More Related