1DV506, Problem Solving and Programming, Autumn 2018


Assignment 3: Methods and Classes


Problems?
Do not hesitate to ask your teaching assistants at the practical meetings (or Jonas at the lectures) if you have any problems. You can also post a question in the assignment forum in Moodle.

Prepare Eclipse for Assignment 3

Create a new package with the name YourLnuUserName_assign3 inside the Java project 1DV506 and save all program files for this assignment inside that package.

Lecture 6 - Methods

In exercises 1 and 2 below you are supposed to create a number of static methods. They should all be created inside the same class that contains the main method. The main method should work as test program that demonstrates how the different methods in your class can be used.

Lecture 7 - Create Your Own Classes

In the exercises below you are supposed to create your own classes. We also want that you, for each class (e.g. MultiDisplay), to create a test program (e.g. MultiDisplayMain) containing a main method that demonstrates how the different methods in your class can be used.

Lecture 8 - More Classes

This section contains a number of exercises where you are supposed to create you own classes. For each task, we expect a Main class, showing how all methods in the class or classes work. For example, for the class Fraction.java there should be a class FractionMain.java showing how all methods of Fraction.java can be used.

All classes are supposed to be commented and follow principles such as encapsulation.




Submission

All exercises should be handed in and we are only interested in your .java files. (Notice that the VG exercises 1.8, 1.9, 2.4, 9 and 10 are not mandatory.) Hence, zip the directory named YourLnuUserName_assign3 (inside directory named src) and submit it using the Moodle submission system.