View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Vehbi Dragaj

CoWeb Assignment 3

1)Usability (2 Points)

Heuristic evaluation is a technique to evaluate the usability of an application. This evaluation is done in four steps:
An advantage of heuristic evaluations is that they are done by experts and the application is tested against well know principles. However, at the same time it might be very expansive to get experts to evaluate the application for you. Heuristic evaluation would be good choice to evaluate an application that is supposed to be used by a variety of users.

Observing Users is an evaluation technique where the actual users interact with the application and the developer observes. The developer has to be able to both see the facial expression of the evaluator and see the screen, what is happening. So, usually a mirror is above, so it can capture both. This can be done either in a special lab for usability evaluation or at the user’s workspace.
Observing users technique has advantage in the sense that you have actual users interact with the application, in this way the developer can observe exactly what will happen with the application once it is deployed. A disadvantage is that the users sometimes are not comfortable to perform the evaluation in front of the developers. Therefore, sometimes the developers chose to video the users evaluate the application. Observing users is a good evaluation technique to evaluate products that are supposed to be used by a specific group of users, because in this way the developer knows exactly who will use the product and how.

2)Object-Oriented Language Design (2 Points)

Java, C++, and C# have primitive types. Eiffel, Ruby, and Smalltalk do not. What are the advantages and disadvantages of having primitive types?

The advantage of using primitive types is that operating on them is much faster than on operation on objects.
However, the disadvantage is that if we use primitive types then there is a uniform lack.

Most OO languages run on a virtual machine. Java and Smalltalk do. C++ does not. What are the advantages and disadvantages of using a virtual machine for OO programming?

There are three main advantages, portability, memory management, and increase in security, and one disadvantage, speed, to using virtual machines for object oriented languages.

CoWeb Assignment 2

Squeak Debugger

When tying to run a squeak project if an error occurs it brings up a debugger window that looks something like this:

Uploaded Image: 03.GIF

As we can see from the picture it gives us four options:

Proceed: if we click on proceed than it will continue running the application.

Abandon: if we click on abandon it will just cancel the action, in other works will remove the debugger window and will not do anything.

Create: if we click create it will give us the option to create a new method with the name that the object is not understanding, in this case setupcomponents and it will give us the option to chose the class where we want to create this new method.

Debug: if we click on the debug button then it will bring up the next window where we will be able to debug the code, just like the following window:

Uploaded Image: ss02.GIF

Here it is important to notice four parts of this picture which I named them 1, 2, 3, 4 respectively:

1. It shows what the problem is? In this case it doesn’t understand the method call. We know that it is a method call because of the ‘#’ in front of the name of the method.
2. It shows us in what class and in what method is the problem.
3. In number 3 we see the method where the problem is being generated and it highlights the portion of the line that is generating the error.
4. Part four of the debugger shows us all the variables and their values at the time right when the error occurs.

Even if there is no error in our project we can bring up the debugger and debug, check the values of the variables and make sure that it is doing what it is supposed to. We can bring the debugger up by calling halt on self. halt brings the debugger up and it is understood by every object. So that mean that you can call halt any time you want in anywhere. Here is another picture showing the debugger brought up by calling halt on self:

Uploaded Image: 04.GIF

This is a short summer of the squeak's debugger, I hope it helps...

CoWeb Assignment 1
The following code solves the rainfall problem, which you may have seen in previous CS classes. For each line, describe what the Smalltalk code does. Be as specific as possible. In particular, what is data at the various points in the code?

'| data onlyPositiveNumbers |' "this line declares two local veriables: data and onlyPositiveNumbers"
data := OrderedCollection withAll: #(1 2 3 -4 -5 'error' 6 -7 999 2). "here an ordered collection is being assigned to data"
onlyPositiveNumbers := [:i | (i isKindOf: Number) and: [i positive]]. "a block is being assigned to the onlyPositiveNumbers"
data := data select: onlyPositiveNumbers. "this line checks every element on data if it is a number and if so if it is positive and if both are true it puts it onto data"
data := data copyUpTo: 999. "this line copies all the numbers on the data that are smaller than 999"
Transcript show: data average "it prints to the transcript the average of all the numbers on data collection, so it prints the average of all the positive numbers that are smaller than 999 that were on the original list"

"on the other words the entire thing took in a collection of objects, looked whose values were positive integers, then out of those positive integers looked which ones where less than 999, and then it took the average and printed to the transcript"

Implement a method in Squeak that will give you the nth Fibonacci number. For both 0 and 1, the Fibonacci number equals 1. From then on, the next in the series is simply the sum of the previous two in the series (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, etc.). Return an error when applicable. Your code should be based on good OO-style and be an efficient algorithm.

I added this method to the Number class which is on the Kernel-Numbers category. the question says return an error when applicable, i could think only two cases one when trying to take the fibonacci of floats and the other one trying to take the fibonacci of numbers smaller then 0, so i check for both of those at the bigining of my method and returned error messages if either one is true. then i check if the number is either 0 or 1 and if so i return a 1, other wise i do a recursive call asking for the fibonacci of the two consecutive smaller numbers and add them.

(self isInteger) "here i ask if it is integer"
ifFalse: [^'You are trying to take the fibonacci of a non integer value']. "if not i print out this error message"
(self 0) "here i check if it is smaller then 0"
ifTrue: [^'Fibonacci for numbers smaller than 0 does not exist']. "if it is smaller then 0, i retun an error message here"
((self = 0) | (self = 1)) "here i check if it is either o or 1"
ifTrue: [^1]. "if it is either 0 or 1 i return a 1"
^(((self - 1) fibonacci) + ((self - 2) fibonacci)) "this is my recursive call"

one last thing to say about fibonacci, to test it i opened a workspace and in there i called fibonacci on some number and then printed it. for example:
5 fibonacci ( highlighted it and prested alt p)


aim: veb2d

Links to this Page