Top Computer Engineering schools - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Top Computer Engineering schools

Description:

University of California Berkeley. Carnegie Mellon (PA) University of Illinois (Champagne-Urbana) 2. Top Computer Engineering schools ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 30
Provided by: paulc1
Category:

less

Transcript and Presenter's Notes

Title: Top Computer Engineering schools


1
Top Computer Engineering schools
  • Smaller Colleges and Universities
  • Rose-Hulman Inst. of Tech. (IN)
  • Cal PolySan Luis Obispo
  • Cooper Union (NY)
  • Harvey Mudd (CA)
  • Rochester Institute of Technology (NY)
  • Larger Universities
  • Massachusetts Inst. of Technology
  • Stanford University (CA)
  • University of CaliforniaBerkeley
  • Carnegie Mellon (PA)
  • University of Illinois (Champagne-Urbana)

2
Top Computer Engineering schools
  • Smaller Colleges and Universities
  • Rose-Hulman Inst. of Tech. (IN)
  • Cal PolySan Luis Obispo
  • Cooper Union (NY)
  • Harvey Mudd (CA)
  • Milwaukee School of Engineering (WI)
  • Larger Universities
  • Massachusetts Inst. of Technology
  • University of CaliforniaBerkeley
  • Stanford University (CA)
  • University of Illinois (Champagne-Urbana)
  • Carnegie Mellon (PA)

3
Other well regarded Computer Sci/Eng schools
  • Local
  • UC Davis
  • San Jose State
  • University of Santa Clara
  • Further away
  • Cornell (NY)
  • Georgia Institute of Technology
  • CalTech
  • Purdue (IN)
  • Princeton (NJ)
  • UCLA, UCSD, UCSB
  • Brown (RI)
  • Dartmouth (NH)
  • Swarthmore (PA)
  • and many, many others

4
Computer Science vs. Computer Engineering
  • Computer Science
  • Liberal Arts--more variety in classes and more
    electives
  • Study more than just programming--create own
    computer language and compiler
  • Not as much Calculus
  • Computer Engineering
  • More emphasis on Hardware and Electronics
  • Lots of Calculus and Engineering classes
  • Not as many opportunities for electives
  • Both majors prepare for careers in programming
    and software design

5
Class Members
  • Classes are built with two kinds of things
    variables and methods
  • class SomeClass
  • int nSomeNum
  • String sSomeWord
  • SomeClass(). . .
  • void someMethod(). . .
  • void someOtherMethod(). . .

6
public and private
  • Class members can be public, private or neither
  • class Bogus
  • private int nX
  • public void setX(int nNum)
  • int nSomeLocalVariable
  • nX nNum
  • //lots more java
  • Local Variables are never public or private

7
public and private
  • private means available only to class members
  • class Bogus
  • private int nX
  • public void setX(int nNum)
  • nX nNum //this is OK
  • //lots more java
  • public void paint (Graphics g)
  • Bogus bob new Bogus()
  • bob.nX 5 //ERROR! Cant use private
  • bob.setX(5) //this is OK

8
public and private
  • public means available anywhere
  • class Bogus
  • private int nX
  • public void setX(int nNum)
  • nX nNum //this is OK
  • //lots more java
  • public static void main(String args)
  • Bogus bob new Bogus()
  • bob.nX 5 //ERROR! Cant use private
  • bob.setX(5) //this is OK

9
interfaces
  • An interface is the collection of non-private
    methods that an object has available for use
  • For instance, the interface of our Particle class
    is
  • move()
  • draw()
  • This informal definition is slightly different
    from the way Java defines an interface

10
Problem put one Oddball Particle into an array
of Particles
  • An Oddball Particle looks and moves differently
    from other particles

11
Problem put one Oddball Particle into an array
of Particles
  • We want to replace one normal particle with an
    Oddball in our particle array
  • First well write a Oddball particle class
  • While it has a draw and move methods, they will
    be implemented differently

12
Problem put one Oddball Particle into an array
of Particles
  • Now Ill replace one of the normal Particles with
    an Oddball
  • public class JumboStarfield extends Applet
    implements Runnable
  • Particle particles
  • //other variables and methods not shown
  • public void init()
  • particles new Particle300
  • for(int nI 0 nI lt particles.length
    nI)
  • particlesnI new Particle()
  • //replace the first particle with a jumbo
  • particles0 new Oddball()

13
Error!
  • Now Ill replace one of the normal Particles with
    an Oddball
  • public class JumboStarfield extends Applet
    implements Runnable
  • Particle particles
  • //other variables and methods not shown
  • public void init()
  • particles new Particle300
  • for(int nI 0 nI lt particles.length
    nI)
  • particlesnI new Particle()
  • //This doesnt work!
  • particles0 new Oddball()

14
Error!
  • Particle particles
  • particles0 new Oddball()
  • An Oddball is not a Particle
  • The types dont match
  • To fix this, we need to create a new type that
    describes both Particles and Oddballs

15
Declaring an interface
  • An interface is a collection of methods
  • interface Point
  • public void draw(Graphics g)
  • public void move()
  • It says All Points have a draw and move method
  • Of course, they can other methods and variables
    as well.

16
implementing an interface
  • When you implement an interface , you are saying
    that your class has the methods the interface
    requires
  • class Oddball implements Point
  • //lots of java
  • public void draw(Graphics g)
  • //lots more java
  • public void move()
  • //lots more java
  • Note interface methods must be public

17
Creating an array of Points
  • If both Particle and Oddball implement Point,
    then I can put either of them in an array of
    Points
  • public class JumboStarfield extends Applet
    implements Runnable
  • Point particles
  • //other variables and methods not shown
  • public void init()
  • particles new Point300
  • for(int nI 0 nI lt particles.length
    nI)
  • particlesi new Particle()
  • //Now this works
  • particles0 new Oddball()

18
Last year, many people made this mistake on the
AP exam
  • This is a mistake
  • Point someParticle new Point()
  • For reference, heres the Point interface
  • interface Point
  • public void draw(Graphics g)
  • public void move()

19
Practice Quiz Question
  • Javabat Array2 gt has77
  • Given an array of ints, return true if the array
    contains two 7's next to each other, or there are
    two 7's separated by one element, such as with
    7, 1, 7.
  • http//www.javabat.com/prob?idArray2.has77
  • Hint Start with the 7s next to each other and
    get that working first

20
Handles
  • You can think of a handle as the name of an
    object
  • String sString
  • Does NOT make a new String, it only makes a
    handle to a String
  • sString new String("hello")
  • Now the handle is "hooked up" to a new "mailbox"

21
Handles
  • String sString

sString
22
Handles
  • String sString
  • sString new String("hello")

"hello"
sString
23
vs. .equals
  • String sString1 new String("hello")
  • String sString2 new String("hello")
  • System.out.println(sString1sString2)
  • System.out.println(sString1.equals(sString2))
  • /Sample Output
  • false
  • true /

24
vs. .equals
  • String sString1 new String("hello")
  • String sString2 new String("hello")
  • System.out.println(sString1sString2)
  • System.out.println(sString1.equals(sString2))

"hello"
sString1
"hello"
sString2
25
vs. .equals
  • String sString1 new String("hello")
  • String sString2 sString1
  • System.out.println(sString1sString2)
  • System.out.println(sString1.equals(sString2))
  • /Sample Output
  • true
  • true /

26
vs. .equals
  • String sString1 new String("hello")
  • String sString2 sString1
  • System.out.println(sString1sString2)
  • System.out.println(sString1.equals(sString2))

"hello"
sString1
sString2
27
vs. .equals
  • Rule always use .equals with objects unless you
    are positive that you need

28
An "orphan"
  • String sString1 new String("hello")
  • String sString2 new String("there")
  • sString1 sString2

"hello"
sString1
"there"
sString2
29
Practice Quiz Questions (true/false)
  • interface Point
  • public void move()
  • public void paint(Graphics g)
  • class Particle implements Point
  • Particle()...
  • //lots of java
  • class Oddball implements Point
  • Oddball()...
  • //lots of java
  • Write true if correct, false for incorrect
  • Point foo new Point()
  • Point myFoos new Point2
  • myFoos0 new Point()
  • myFoos1 new Oddball()
  • Particle bob new Particle() bob.move()
  • Point foo new Particle()
Write a Comment
User Comments (0)
About PowerShow.com