Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Test 3(13 points) Inheritance and Polymorhpism. 1) (3 points)Design an interface named Shapable containing two methods: calArea() and calPerimeter(). The method calArea() returns the area

image text in transcribed

Test 3(13 points) Inheritance and Polymorhpism. 1) (3 points)Design an interface named Shapable containing two methods: calArea() and calPerimeter(). The method calArea() returns the area of the given shape and the method calPerimeter () returns the perimeter of the given shape. 2/3 2) (4 points)Design a class named Rectangle implementing Shapable. a) Declare two instance variables width and height. b) Overload constructors. c) Override the method calArea(). d) Override the method calPerimeter(). e) Define setters and getters. 3) (4 points) Design a class named Triangle implementing Shapable. a) Declare properties for a triangle b) Overload constructors. c) Override the method calArea(). d) Override the method calPerimeter(). e) Append the method named is RightTriangle() to test if it is a right triangle. If so, the method returns true. Otherwise it returns false. 4) (2points) Create a project to test whether all of subclasses meet the requirements Test 4(10 points) Java API and Its application Write a project to copy a text file. For example, copy a text file test.txt from d:\data\ to k:\datal. The project needs to perform the followings

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions