Lecture 14 review of term so far
This presentation is the property of its rightful owner.
Sponsored Links
1 / 5

Lecture 14: Review of Term (So FAR) PowerPoint PPT Presentation


  • 43 Views
  • Uploaded on
  • Presentation posted in: General

Lecture 14: Review of Term (So FAR). Methods.

Download Presentation

Lecture 14: Review of Term (So FAR)

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Lecture 14 review of term so far

Lecture 14:Review of Term (So FAR)


Methods

Methods

public classSum {private intval;Sum(intv) { val = v; }Sum() {this(0); }void inc(inti) {val += i; }void inc(Sum s) {val += s.val; }public static void main(String[] args) {Sumsq = new Sum();SumsumSq = new Sum(); for (inti = 0; i < 4; i++) {sq.inc((2 * i) + 1);sumSq.inc(sq);System.out.println(sq.val); }System.out.println(sumSq.val);}

}


Methods1

Methods

public classSumTwoextends Sum {SumTwo(intv) { super(v); }void inc(inti, intj) {inc(i+ j); }public static void main(String[] args) {SumnotFib = new SumTwo(0);intfst = 0;intsnd = 1; for (inti = 0; i < 4; i++) {notFib.inc(fst, snd);inttmp = fst + snd;fst = snd;snd = tmp; }System.out.println(notFib.val);}

}


For midterm

For Midterm

  • You can use on this midterm:

    • You can always use yourtextbook & notes

    • Printout of slides IF has notes on that day's slides

  • At the same time, you may NOT use:

    • Computer, calculator, cell phone, or similar

    • Copies of daily activities and/or solutions

    • Friends, Romans, countrymen or their ears


How to prepare for midterm

How to Prepare for Midterm

DO

DON'T

  • Make cheat sheets for the test

  • Review how parts of Java work

  • Add post-its to important pages

  • Memorize

  • Drink case of 40s before test

  • Use post-its as clothing


  • Login