Create a class which defines a "Garment" object.

完了済み 投稿 Aug 10, 2013 着払い
完了済み

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: #4812463

プロジェクトについて

2個の提案 リモートプロジェクト アクティブ Aug 10, 2013

アワード:

bhatkiran

Software engineer with 3+ years professional experience in java

$2 USD / 時間
(10レビュー)
3.0

2 人のフリーランサーが、平均$3/時間で、この仕事に入札しています。

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 / 時間
(レビュー1件)
0.0