r/learnjavascript • u/NovaPhoenix0208 • Jun 01 '19
JavaScript Help
Anyone around willing to give a guy who lied about knowing JavaScript some help with a uni assignment due in 2 days?
1
u/Errkal Jun 01 '19
How far have you got, what do you need to do, what is tripping you up?
-2
u/NovaPhoenix0208 Jun 01 '19
Basically how to get it started:
First step is to create a class called Order (Order.java) which will not contain a main.
The Order class will be very simple which will contain two private instance variables:
o customerName as a String
o garments as an integer
The following public methods will have to be implemented:
o A default constructor
o A parameterised constructor
o Two set methods (mutators)
o Two get methods (accessors)
o calculateCharge value returning method*
*You will create a public value returning method calculateCharge(), the order charges can be derived
from the instance variable garments. Typically we do not store calculated values in a database so the
charge will be derived via your calculateCharge() method. Do not store the charge as an instance
variable.
What would be the first thing I do?
After that, I can work it out but its just this part that is tripping me up
17
0
1
1
u/not-so-stupid-idiot Jun 01 '19
Go through his playlist. It won’t take long, it’s easy to follow, has exactly what you’re looking for. Everything you need should be within the first few videos.
5
u/Ekid113 Jun 01 '19
Keep searching and push through- the only way to learn is to do.
What is general assignment?