HW3 -...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: ----------------------------------------------------------------------HW#3 SPECSCS108, SPRING 2009----------------------------------------------------------------------In a file named Triangle.java,write complete code to create a "Triangle" class as follows:Instance variables, assume all are "double":* a -- length of side a, assume "public"* b -- length of side b, assume "public"* c -- length of side c, assume "private".Instance variable, assume "private":* btsvec -- a Vector used to store every value assigned to c.Instance methods (accessor and mutator):* setC -- sets a value for c.Therefore, setC should also store the value into btsvec, too.setC should also do data validation, prohibiting c frombecoming 0 or negative.(Caution: remember that Vectors can't store the8 primitive data types, so should store c as aString object or a Double object.)* getC -- accessor method for the c property....
View Full Document

Page1 / 2

HW3 -...

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