Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
CS1110. Lecture/lab summary We show Click here for expected future lectures Calendar (list of lectures, showing also prelims, some assignments) Past and pending lectures and labs Lecture 28. 08 May (Thursday). Conclusion. Don't miss it! Discussion of CS history  pdf   ppt Lab 13. No assigned lab. The Lab TAs and consultants will be in the lab to answer questions about A7 and the final. Lecture 27. 04 May (Tuesday). OO programming. We discuss the idea of OO programming and how one decides on the classes to design and imlpement. pdf   ppt   showboat.zip (the java demo) Lecture 26. 29 April (Thursday). Interfaces. An interface is like an abstract class in which all methods are abstract. A class may extend only one other class, but it can "implement" several interfaces. We show how this feature can be used effectively. pdf   ppt Lab 12. Exception handling. Read the text (Chapter 10) before coming to lab, to make this lab easier. pdf   doc   Lab13.java Lecture 25. 27 April(Tuesday). Applications and Applets. A stand-alone Java program —one that can be executed outside of DrJava— is either an "application" or an "applet". An application can be executed from a command line in a "terminal" or "DOS" window, or one can double-click on them to start it. Applets are started when an html web page contains the proper "applet tag". We show you how to make a Java program into an application and into an applet, we show you how to create a jar file that contains an application or an applet, and we also look at the language html, which is used to construct web pages.   pdf    ppt    Lecture 24. 22 April (Thursday). Ragged arrays. We show you how arrays are implemented. The implementation allows us to have "ragged" arrays --arrays in which different rows can have different lengths. pdf    ppt Lab 13. No assigned lab today. The TAs and consultants will be in the lab to answer questions about prelim 3 and assignment A7. Lecture 23. 20 April (Tuesday). Exceptions. An "Exception" is an "untoward" event like division by 0 or a subscript out of range. Java has a nice facility for handling and recovering from Exceptions.   pdf   ppt   Ex.java  OurException.java     Reader.java Lecture 22. 15 April (Thursday). Listening to GUIs. We show how to listen to mouse clicks on buttons, mouse clicks in on components, and keystrokes. pdf   ppt   javaFilesUsedInClass (zip file) and other examples of gui-listeners: See Chapter 17 of the CD ProgramLive. Lab 11. Timing execution. We show you how to time execution of a method call and ask you to compare times for various searching and sorting methods.  pdf  doc  Sorting.java    TestArrays.java Lecture 21. 13 April (Tuesday). Placing components in GUIs. We look at placing components in GUIs. The important points we want you to remember is how a BorderLayout manager is used to place components in a JFrame, a FlowLayout manager in a JPanel, and a BoxLayout manager in a Box (and what this all means!). After the lecture, listen to lectures on the CD ProgramLive in chapter 17 --that's the best way to learn the stuff. pdf    ppt   zip file containing demos Lecture 20. 08 April (Thursday). Finding an invariant: important algorithms. We continue our study of developing algorithms that process arrays. No new slides for this lecture. Lab 10. Exercises with loops. This lab asks you to develop loops from specifications and given invariants, giving you practice with the methdology for developing loops.   pdf   doc Lecture 19. 06 April (Tuesday). Finding an invariant: important algorithms. We develop the binary search, linear search, and some sorting algrithms. Sorting.java contains all the searching/sorting methods we use in this class. Download it.    pdf    ppt    Sorting.java Lecture 18. 01 April (Thursday). Finding an invariant: important algorithms. We look at how to combine diagrams for pre- and post-conditions of an algorithm into an invariant for a loop and use it to develop some interesting algorithms that have loops.    pdf   ppt Lab 09. Reading files. We show you how to read a file that is on your hard drive. Reading a keyboard and writing as file is just as easy.   pdf   html   LabReadingFiles.java   test.txt   or get them all here:  lab09reading.zip Lecture 17. 30 March (Tuesday). Assignment 6 and debugging. We discuss assignment A6, Images. We then talk about debugging a program. The powerpoint slides do not show everything we did because we concentrate on finding errors using DrJava. You can look at the lecture at www.cs.cornell.edu/videonote/cornell. pdf    ppt Lecture 16. 18 March (Tuesday). Arrays. We introduce arrays. An array, like Vector, is an object that can contain a list of things. A variable of type int[] contains the name of an object that contains a list of ints. A variable of type JFrame[] contains the name of an object that contains a list of JFrame objects. Type array is built into Java; there is a nice mathematical notation b[i] for accessing element i of array b. We consider right and wrong methods for swapping values of array entries.   pdf     ppt Lab 08. For-loops and assertions. This lab deals with some paper-and-pencil exercises on ranges, assertions, and for-loops. It also asks you to write four functions whose bodies contain for-loops.   pdf    doc   Lab08.java Lecture 15. 16 March (Tuesday). The while loop. We introduce the while loop, relate it to the for-loop, talk about the four loopy questions for understanding a while loop, and develop some while loops.   pdf    ppt Lecture 14. 11 March (Thursday). More on loops. We continue with the discussion of developing for-loops that process a range of integers, using postconditions and invariants.   pdf    ppt Lab 07. Abstract classes and methods. We introduce the notions of abstract classes and methods and state why they are useful. The example program you will play with gives you practice with them.    pdf   html  DemoShapes.java  Shape.java  Parallelogram.java  Rhombus.java  Square.java Lecture 13. 09 March (Tuesday). Loops We begin a discussion of loops, starting with a for-loop to process a range of integers. pdf   ppt Lecture 12. 04 March (Thursday). Drawing and casting about. We work on further issues with classes and subclasses that arise from the distinction between apparent and real classes, and examine the use of casting and instanceof in these contexts.   pdf   ppt   Acct.java  Gm.java   Hm.java Lab 06. Recursion. You will write at least 4 recursive functions.   pdf    html   Rec.java Lecture 11. 02 March (Tuesday). Recursion! We develop a few more recursive procedures, including Hilbert's space-filling curve. We execute some recursive calls. As we figure out how many recursive calls one function makes, we will have to discuss the binary number system. pdf   ppt   09oct06demo.zip This file contains (1) Class D, which contains the recursive functions written during this lecture; (2) class PairDI; (3) classes Demo and Turtle, which were used to draw Hilbert space-filling curves. To draw a space-filing curve, use function Demo.doAHilbert —see its specification. Lecture 10. 25 February (Thursday). Recursion! We introduce recursion: a method calling itself. This provides power and flexibility that we haven't had yet, and you will (should) be amazed at how simple it will be to do neat things.   pdf   ppt    Demo.java (contains functions we wrote in class) Lab 05. Class Vector. An instance of class Vector can contain a list of objects, and the list can expand and shrink. In this lab, we study this class. It will be used in a lot of our future work.   pdf    html    Lab05.java Lecture 09. 23 February (Tuesday). Wrapper classes and stepwise refinement! Each primitive type has an associated "wrapper class". An object of the wrapper class contains one value of the primitive type. We show you why this is useful. We also spend more time developing algorithms dealing with Strings, showing you "top-down programming" and "stepwise refinement" in the context of a real java program.  pdf    ppt  Course.java   DeptLink.java Lecture 08. 18 February (Thursday). Odds and ends on classes. Stepwise refinement We make some points about multiple constructors, overriding, and constructors in subclasses. We then develop some more String functions and talk about stepwise refinement.     pdf   ppt two classes for anglicization functions:   Ang.java   AngTester.java Lab 04. Writing functions. You will practice writing functions that deal with Strings. Please study the first part of the lab, on Strings and string equality, BEFORE Tuesday, so that you don't have to waste time in lab. This will help also in understanding Tuesday's lecture. An important point should become clear: a value of String is an object , so a test s == t  where s and t are Strings tests whether they are the same folder or not. Method call s.equals(t) should be used to test whether two Strings have the same value.  pdf   html   Methods.javaThe Knack Lecture 07. 16 February (Tuesday). Inside-out, super-this, and stepwise refinement We illustrate the inside-out rule for referencing variables and methods, which is used in most programming languages. We discuss this and super. The main topic is stepwise refinement --a way to think about the development of methods from their specifications-- and develop an interesting function using it. pdf    ppt   two classes for anglicization functions:   Ang.java   AngTester.java Lecture 06. 11 February (Thursday). Methods We look more closely at how a method call is executed. We show the four steps involved in executing a method call. We introduce local variables. We now have four kinds of variable: parameter, static variable, field, and local variable. You should know where and how each is declared and what its scope is. We introduce conditional statements and return statements.   pdf   ppt Lab 03. Two topics: testing and static variables. You will practice creating a test class to test and help find bugs in a class that we give you. Also, we give you some things to do to make clear to you when methods can be made static.  pdf   html   ThreeDimPoint.java Lecture 05. 09 February (Tuesday). Testing; the class hierarchy; static variables and methods. We discuss testing, including with JUnit. We talk about the class hierarchy and show you the superest class of them all: Object. We discuss function toString. We introduce static variables and methods.  pdf   ppt   Worker.java   WorkerTester.java Lecture 04. 4 February (Thursday). Customizing a class: getters, setters, constructors We discuss fields and getter and setter methods for them. We introduce constructors, whose purpose is to initialize (some) fields of a newly created object  pdf   ppt Lab 02. Objects and classes. You will practice creating and manipulating JFrame objects using DrJava's interactions pane. Then, you will write your first class definition —a subclass of JFrame, and experiment with it.    pdf   html Lecture 03. 02 February (Tuesday). Customizing a class We introduce the class definition, which describes the format of all manila folders (object, instances) of a class. We illustrate using a "subclass" of JFrame customized to our needs. We show how to create a class"specification" using the javadoc facility. pdf   ppt Here is Richard Felder's website on learning styles: www4.ncsu.edu/unity/lockers/users/f/felder/public/Learning_Styles.html Lecture 02. 28 January (Thursday). We define what an object (manilla folder) is and demo the creation and manipulation of objects in DrJava. This material, in Sect. 1.3 of the text, is the basis for the next lecture, so study the material and practice using DrJava. Look at the self-study exercises in the text and do some of them. The more you practice, the easier it will seem.   pdf   ppt Lab 01. Java expressions. This lab involves practice with Java expressions and assignments using the DrJava Interactions pane.   pdf   html Lecture 01. 26 January (Tuesday). Introduction to the course --brief overview of what we missed last Thursday. Discussion of Java types, expressions, variable declarations, and assignment statements. Lecture handout: pdf   ppt   Future lectures The list of lectures and labs shown below are for Spring 2009. They will give you an idea of where we are headed in the Fall 2009 course. The links given below will not work. ab 12. Exception handling. This lab asks you to study and write code that uses exceptions, throw clauses, try-statements, etc. This lab is optional. During teh lab session, you can work on it or on A7. The TAs and consultants will be there to help. pdf   doc   Lab12.java Lecture 25. 01 December (Tuesday). Applications and Applets. A stand-alone Java program —one that can be executed outside of DrJava— is either an "application" or an "applet". An application can be executed from a command line in a "terminal" or "DOS" window, or one can double-click on them to start it. Applets are started when an html web page contains the proper "applet tag". We show you how to make a Java program into an application and into an applet, we show you how to create a jar file that contains an application or an applet, and we also look at the language html, which is used to construct web pages.   pdf    ppt   zip file containing demos Lecture 24. 24 November (Tuesday). Ragged arrays. pdf    ppt Lecture 23. 19 November (Thursday). Exceptions. An "Exception" is an "untoward" event like division by 0 or a subscript out of range. Java has a nice facility for handling and recovering from Exceptions.   pdf   updated ppt   Ex.java  OurException.java     Reader.java Lab 13. Timing execution. We show you how to time execution of a method call and ask you to compare times for various searching and sorting methods.  pdf  doc  Sorting.java    TestArrays.java     Lecture 12. 08 October (Thursday). Lie detection using recursion. We develop a recursive procedure for determining whether particular words might be false-statement or not-known-to-be-false-statement cues, using political transcripts as data.     pdf     09oct08demo.zip   The latter file contains (a) LieData.java and TallyPair.java, where TallyPair is our "throwaway" helper class (which is why we made its fields public. Note that in the 9:05 lecture we folded this class into LieData.java, which is the "right" way to handle "throwaway" classes, but that technique used some concepts we haven't learned about yet. The solution presented in these files, where TallyPair is a separate class, works fine given our current knowledge); (b) In.java for converting file contents to Strings; (c) LieDataTester.java and test.htm, files for running small tests, and (d) powell.htm, a lightly-processed version of Colin Powell's public statements regarding Iraq as annotated by the Iraq War Card project.         Lab 13. No assignment. The Lab TAs and consultants will be at the lab. Use the time to work on the last programming assignment and be able to ask questions and get help. Lecture 27. 28 Apr (Tuesday). OO programming. We discuss the idea of OO programming and how one decides on the classes to design and imlpement. pdf   ppt   showboat.zip (the java demo) Lecture 26. 23 Apr (Thursday). Two-dimensional arrays After we look at two-dimensional arrays as rectangular arrays, we then show how Java implements two-dimensional arrays and explain how one can have ragged arrays —arrays where different rows can have different numbers of columns. pdf   ppt Lecture 25. 21 Apr (Tuesday). Interfaces. We introduce the interface as a means for requiring that a class implement certain methods. We show how an interface can be used as a type, and this leads to the ability to write a procedure that will sort an array of elements of any type-class as long as that type-class implements a certain interface. pdf   ppt   javademo.zip Lab 11. Formatting in locales. A "locale" is a country together with a language used in that country. This lab gives you experience with class Locale, instances of which give you functions that format numbers, percentages, and currencies in the way that those locales use. For Americans, this can be an eye-opener!  pdf   html   JLiveWindow.java   MyJLiveWindow.java Lecture 20. 11 November (Thursday). Finding an invariant: important algorithms. We continue look at how to combine diagrams for pre- and post-conditions of an algorithm into an invariant for a loop. We develop insertion sort, selection sort, and the recursive quick sort. We give a historical perspective on programming.    pdf    powerpoint    Sorting.java Put this file spin.gif intoyour favorite browser and take the left-brain-right-brain test. This website discusses whether this spinning dancer tells you anything about your brain: scienceline.org/2007/10/29/ask-hsu-spinning-girl-right-left-brain-hemispheres/    opticalIllusions.pps