2nd Year


Application for a computer shop
Simple calculator
Presentation regarding the IPR of a software

Application for a computer shop


Module : Object Oriented Development
Assignment Type : Group
Other group members :
1. Sahan Serasinghe
2. Dhanushka Jayaweera
3. Kasun Samaranayaka

The task is to create a graphical application using Java Swing which simulates an online shop selling computers with different characteristics (e.g. laptop, desktop, CPU, speed, hard drive, graphics card, make). Customers should be able to choose the characteristics of the computer that they would like to purchase.

The user (customer wishing to purchase a computer) should be able to login by typing his user name and password and pressing the “Login” button.

When the user types the valid user name and password and presses the “login” button, the background changes to green and the string “Welcome to ECSE501 Computers” is displayed.

When the user types an incorrect user name or password, the background of the window becomes red, the message “Incorrect login name/password” is displayed and the user is given a chance to re-enter a username and password.

After the user logins, he is presented with various choices about buying a computer. Design and implement one or more appropriate screens in your Swing application which allow the user to select whether he wishes to buy a laptop or desktop and subsequently what kind of “appropriate” components he would like to have in his laptop or desktop (e.g. CPU type and speed, hard disk, graphics card, etc.).

As soon as the user selects his options and presses the submit button a price is displayed on the screen.

After the user is presented with a price he has the option to press either a “Purchase” button (in which case the whole application terminates and exits) or a “Go back to reselect components” button in which case the user is presented with the component selection screen.

Simple calculator


Module : Object Oriented Development
Assignment Type : Individual

The task is to create a program which simulates very simple calculator using Java language.
The details for the implementation of the system are given in the steps below:

Design and implement an abstract base class ArithmeticExpression that represent any binary (having two arguments) arithmetic expression. In this coursework you will be implementing various subclasses of this class. The abstract class should include at least two methods called evaluate and display which are described below.

Design and implement concrete (non-abstract) classes which are sub classes of the class ArithmeticExpression and each one represents some simple arithmetic expression. The operations that you should implement for each subclass should include the binary (i.e. accepting exactly two arguments) operations of addition, subtraction, multiplication and division (all of them accepting double type arguments). Using the classes you should be able to represent an arbitrary expression (i.e. an expression with an arbitrary number of terms), for example an expression like ”(5.0+8.1)*(2.0)” or ”((5.0+8.1)*(2.0))/12.5” (not specifically in this format but represent the overall expression in an equivalent way).

Implement methods evaluate and display. Method evaluate evaluates the arithmetic expression that the object represents and returns the result as a double. For example, calling it in an object representing expression ”(5.0+8.1)*(2.0)” should return 26.2. Method display prints the raw (unevaluated) expression on the screen. For example, calling it in an object representing expression ”(5.0+8.1)*(2.0)” should display the string ”(5.0+8.1)*(2.0)” (without the quotes). You should NOT use static methods!

Implement a test class CalculatorTest which tests the functionality of your classes

Implement a class RandomCalculations which automatically creates a random number of random expressions and uses your classes above to evaluate and display them.


Presentation regarding the IPR of a software


Module : Professional Practice
Assignment Type : Group
Other group members :
1. Sahan Serasinghe
2. Dhanushka Jayaweera
3. Dilhan Sameera

The topic of the presentation was “Who owns the IPR of a piece of software developed at work? Who carries the can if that software goes wrong”. My task was to explain the subtopic “Who owns IPR of a software?”

Presentation : Who owns the IPR of a software

4 thoughts on “2nd Year

So.. What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s