tut02_2009 - EE3206/EE5805 Java Programming and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
EE3206/EE5805 Java Programming and Applications Tutorial 2 – Writing Simple Java Applications 1. Create a class Circle and write a method to calculate the area of a circle with a given radius value. The method header is shown below. Write another main method within the same class to show the area of circles of radius ranging from 10 to 100, with each increment of 10 (i.e. 10, 20, 30,… 100). static double circleArea(double radius) 2. Create a class Matrix and write two methods for adding and displaying matrices. Their method headers are shown below. The first method adds the second matrix to the first matrix and returns true on success. The second method displays the values of a matrix in a square bracket. public static boolean addMatrix(int[][] matrix1, int[][] matrix2) public static void printMatrix(int[][] matrix) 3. Create a class TestMatrix together with a main method. Test your Matrix class above by passing some integer matrices to it, performing addition, and showing the result. Here are some examples:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/20/2010 for the course ELECTRONIC EE3206 taught by Professor Tingchiwang during the Spring '10 term at École Normale Supérieure.

Page1 / 2

tut02_2009 - EE3206/EE5805 Java Programming and...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online