DOC PREVIEW
TRINITY CSCI 1311 - Methods and Problem Decomposition
Pages 9

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Methods and Problem Decomposition9-10-2010Opening Discussion●Finishing “walking”.●Minute Essay responses–Do you know enough to do the IcP? What if you read ahead?–Do all classes have the same number of methods?–How do you keep track of this stuff? It seems arbitrary and overwhelming.–Can you make actors do two methods at once?More comments–Can you make your actor move in a way that isn't in the API?–What does Boolean mean?–What does PSPG stand for?–Can you give a different set of directions to each instance of an actor class?–How long should it take to solve a coding problem?–Is it possible to load your own images into Greenfoot?Even More Comments–Can the Greenfoot API change?–How many actors can you have in a scenario.–Could we add trees or cars?–Will we learn the other 6 statement types?–Could we use move(); in the person to make them walk like the Wombat?–Is there always more than one way to write code to do something?–The IcP is modifying an existing scenario.Writing New Methods●Last time we filled in some code in a method that was already part of the CityScape scenario.●Today we want to write some of our own methods. What type of functionality should we add to our person or our buildings?Problem Decomposition●One of the main reasons for having methods is that they allow us to break a big problem up into little pieces.●Computer Science is often about controlling complexity. Big problems are complex and therefore hard to solve.●You should always take a big problem and break it into pieces such that each piece is easy. Never solve a hard problem.Design Approaches●Top-down vs. bottom-up●Top-down–Start with the big problem and repeatedly break it into pieces.●Bottom-up–Start with little pieces you know how to do and put them together to solve bigger problems.Modulo and Integer Division●When you divide ints you get an int. Any fractional part is thrown away.●The remainder from division is given by the modulo operator, %.●We can do some fun things using these operators.●Let's make our person walk back and forth.Minute Essay●What do you think we should do with CityScape over the next few class meetings?●Remember that you will be showing off your interclass problems on Monday. If you have to miss class you should e-mail it to


View Full Document

TRINITY CSCI 1311 - Methods and Problem Decomposition

Course: Csci 1311-
Pages: 9
Documents in this Course
Arrays

Arrays

12 pages

Arrays

Arrays

10 pages

Applets

Applets

5 pages

Arrays

Arrays

8 pages

Methods

Methods

12 pages

Drawing

Drawing

8 pages

Load more
Download Methods and Problem Decomposition
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Methods and Problem Decomposition and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Methods and Problem Decomposition 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?