Pages

Sunday, November 22, 2009

Urgent! Can you please solve the following Java Problems?

Hey one of my friend from Twitter needs solution codes for the following Java problems, I don't know much about Java, can you please solve the following problems, and give the solution codes in the comment section below?


5. Write a program to calculate the area of a Rectangle & a Square using the concept of overloading.

6. Create a complex class with data members as real and imaginary. Overload three constructors to initialize the data members (i.e. default, normal, and through object initialization). Provide methods which returns object of the complex class as the result for addition, subtraction, multiplication of two complex numbers.

7. Write a program to maintain the office database using single inheritance. Superclass is Employee that contain the information as follows- Emp_code, Emp_name, Address, Ph_no, Da-80%, Hra-15%. Create three subclass of Manager, Typist, officer each class having their own basic pay.

8. Write a program to display the inner-volume and outer-volume of a machine using an interface called Volume. Assume that there is a part in a machine having three dimension s1,s2,s3 and
Involume=1/3*pi*s1*s2*s3
Outvolume=4/3* pi*s1*s2*s3

9. Define an Exception “NoMatchFoundException” that is thrown when “Kolkata” is not found from the following set of strings.
city name ={ Kolkata, Chennai, Mumbai, Delhi, Bangalore, Amedabad}