Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36080 > unrolled thread

Help in codes please

Started bykainattshafiq90@gmail.com
First post2016-12-10 16:27 -0800
Last post2016-12-11 08:54 -0800
Articles 3 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Help in codes please kainattshafiq90@gmail.com - 2016-12-10 16:27 -0800
    Re: Help in codes please Martin Gregorie <martin@address-in-sig.invalid> - 2016-12-11 10:00 +0000
    Help in codes please lewbloch@gmail.com - 2016-12-11 08:54 -0800

#36080 — Help in codes please

Fromkainattshafiq90@gmail.com
Date2016-12-10 16:27 -0800
SubjectHelp in codes please
Message-ID<f1cf313a-a153-4865-92a0-def56b5147fc@googlegroups.com>
Hi, can someone please help me code this??? 

Gadget class has four attributes, which correspond to the model, 

- The price (in pounds)
- The weight (in grams)
- The size (e.g. “71mm x 137mm x 9mm”) respectively


The price is a decimal number
- The weight is an integer
- The model and the size are strings of text

Each attribute is initialized in the constructor, by being assigned the value of one of the constructor's four parameters, and each attribute has a corresponding accessor method. 

A display method will output (suitably annotated) the model, the price, the weight and the size.

Please someone help me. 

THANK YOU SO MUCH

[toc] | [next] | [standalone]


#36081

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-12-11 10:00 +0000
Message-ID<o2j83h$let$1@dont-email.me>
In reply to#36080
On Sat, 10 Dec 2016 16:27:39 -0800, kainattshafiq90 wrote:

> Hi, can someone please help me code this???
> 
> Gadget class has four attributes, which correspond to the model,
> 
> - The price (in pounds)
> - The weight (in grams)
> - The size (e.g. “71mm x 137mm x 9mm”) respectively
> 
> 
> The price is a decimal number - The weight is an integer - The model and
> the size are strings of text
> 
> Each attribute is initialized in the constructor, by being assigned the
> value of one of the constructor's four parameters, and each attribute
> has a corresponding accessor method.
>
This looks like Java 101 homework. However, it seems that you've not made 
any attempt to help yourself yet, so:

- Read your Java language manual.
- Write code that you think should answer the problem.
- Compile it. Test it.
- If it doesn't work and you don't understand why, show us your code
  and ask again.

Hints:

Make sure you add a toString() method to your homework class so you can 
see whether its constructor did what you expect.

Write a test program. This must have a main() method that creates an 
instance of your homework class, calls its toString() method and displays 
the result.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#36082

Fromlewbloch@gmail.com
Date2016-12-11 08:54 -0800
Message-ID<e001c354-ef8e-411e-9297-035e44ba7813@googlegroups.com>
In reply to#36080
What have you tried so far?
What is the specific difficulty you have?
With respect to your specific difficulty, what in the documentation is failing to help, and why?

HTH,
Lew

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web