Alice chap 2

# Alice chap 2 - 2 DEVELOPING METHODS IN ALICE After...

This preview shows pages 1–3. Sign up to view the full content.

After finishing this chapter, you should be able to: o Provide brief definitions of the following terms: CamelCase, coding, encapsulated methods, integration test, method header, modular development, off-camera, parame- ter, primitive methods, program development cycle, reusable code, test for correctness, testing shell, top-down design, unit test, user-defined methods, and variable. o Describe the processes known as top-down design and modular development, includ- ing why they are often used together, how organizational charts are involved, and some of the advantages of modular development of new software. o List and describe the steps in a simple program development cycle. o Describe the difference between primitive methods and user-created methods in Alice, and show how to run primitive methods to directly position objects and manipulate the camera in an Alice world. o Create new methods in Alice in a manner that demonstrates good top-down design and modular development. o Create and demonstrate the use of generic methods in Alice that contain method parameters. DEVELOPING METHODS IN ALICE 1 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Chapter 2 • Developing Methods in Alice TOP-DOWN DESIGN AND MODULAR DEVELOPMENT The process of developing methods for objects is mostly a process of developing algorithms because each method is an algorithm. Algorithm development has a long history in the world of mathematics, in which algorithms are step-by-step solutions to well-defined mathematical problems, such as finding the least common denominator of two fractions. Traditional approaches to mathematical problem solving have been applied to many different disciplines that rely on mathematics, such as engineering, the physical and social sciences, and computer programming. Generally, a problem must be clearly specified, so that once a solution has been developed, it can be compared to the specifications to determine its correctness. It’s easier to solve smaller problems than it is to solve big ones, so good mathematicians often start solving a problem by trying to break a large algorithm into parts that are more manage- able. This process of decomposition is sometimes called a divide and conquer approach to problem solving, in which a problem is broken into parts, those parts are solved individually, and then the smaller solutions are assembled into a big solution. Computer programmers do the same thing when developing new software. This process is also known as top-down design or top-down development , starting at the top with one concept or big idea, and then breaking that down into several parts. If those parts can be further broken down, then the process continues. The end result is a collection of small solutions, called modules, which collectively contain the overall solution to the original problem. Let’s look at an example of top-down development. Imagine that you want to write a com-
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 32

Alice chap 2 - 2 DEVELOPING METHODS IN ALICE After...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online