Create a class which defines a "Garment" object.

Lengkap Disiarkan Aug 10, 2013 Dibayar semasa penghantaran
Lengkap

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

ID Projek: #4812463

Tentang projek

2 cadangan Projek jarak jauh Aktif Aug 10, 2013

Dianugerahkan kepada:

bhatkiran

Software engineer with 3+ years professional experience in java

$2 USD / jam
(10 Ulasan)
3.0

2 pekerja bebas membida secara purata $3/jam untuk pekerjaan ini

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 / jam
(1 Ulasan)
0.0