their values in the questions below.Write a class Item (in the default package of the NetBean) with the following information:
Item Where:
2 of 3 Paper No: 1
-name:String
-quantity:int
Item() - default constructor.
-status:String
+Item()
Item(name:String, quantity:int)-parameterized constructor that sets values to name and quantity. If the quantity is less than 0 then set it to 0 and the status
+Item(name:String,quantity:int)
is "N/A", otherwise set the status to "A"
+getName():String
+setName(name: String):void
+getQuantity():int
getName():String - return name in uppercase.setName(name:String):void - update the name.
setQuantity(quantity:int):void
getQuantity():int - return the quantity.
+ +toString(): String
setQuantity(quantity:int):void - update the quantity. If
quantity is less than 0 then set it to O and status is "N/A", otherwise set status to "A"
toString(): String - return a string format that contains
all the information of the Item: name, quantity, status.
The name in uppercase format.
Do not format the result.
The main method is ready in the Main.class file. The program output might look something like this:
Enter name: tivi
Enter name: tivi
Enter name: tivi
Enter name: tivi
Enter quantity: 3
Enter quantity: 9
1. Test getName
2. Test setQuantity
Enter quantity: -1
Enter quantity: 3
1. Test getName
1. Test getName
1. Test getName
2. Test setQuantity
2. Test setQuantity
2. Test setQuantity
+ 93%
Close