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

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 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 8 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 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Methods and Problem Decomposition1-27-2010Opening Discussion●Minute Essay responses–Can we move the person to the house? If so, which will we see?–Static methods and calling things in the Greenfoot class.–How long should you expect to spend on interclass problems?–Does the API vary depending on the program you use? Will Greenfoot.getRandomNumber work on other programs?More comments–What is the difference between public and private?–Do you work on IcPs before class?–Should readings be done before or after the class they are listed for?–Could we pull code from Wombats to help make things happen?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 Friday. 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: 8
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?