Create a class which defines a "Garment" object.

Completed Posted Aug 10, 2013 Paid on delivery
Completed

Assume that you are creating a class which defines a “Garment” object. Your class has the following variables:

private int gType;

private int gColor;

1. Code the constructor for the Garment class which has two formal parameters whose values are assigned into the class variables.

2. Code a mutator method for the gColor variable.

3. Assume that the gType variable contains a 1 for shirt and a 2 for pants, no other values will be loaded into this variable. Likewise the gColor variable contains a 1, 2 or 3 for red, green and blue respectively. Code the “toString” method for the “Garment” class which returns a string of the form: color space type. For example if gType contains a 1 (for a shirt) and gColor contains a 2 (for green) the method should return: green shirt

Java

Project ID: #4812463

About the project

2 proposals Remote project Active Aug 10, 2013

Awarded to:

bhatkiran

Software engineer with 3+ years professional experience in java

$2 USD / hour
(10 Reviews)
3.0

2 freelancers are bidding on average $3/hour for this job

HetalVyas

Dear Employer.. This is a simple task. I can do with nice structure and excetpion handling. If any more details please send me,

$4 USD / hour
(1 Review)
0.0