Course Solutions Uncategorized (Solved) : Following Java Class Simplified Shopping Cart Number Attributes Methods Public Class Shopp Q29804566 . . . .

(Solved) : Following Java Class Simplified Shopping Cart Number Attributes Methods Public Class Shopp Q29804566 . . . .

 

The following is a Java class of simplified shopping cart, whichhas a number of
attributes and methods.
public class shoppingCart {
private String customerName;
private String customerAssress;
private String contactNumber;
……
private List<String> cartItems = newArrayList<String>();
……
public String addItem (String str) {
if (!cartItems.contains(str)) {
cartItems.add(str);
return new String(“The item has been added”);
} else return new String(“The item already existed”); }
public String removeItem(String str) {
if (cartItems.contains(str)) {
cartItems.remove(str);
return new String(“The item has been removed”);
} else return new String(“The item does not exist”);
}
……
}
(a) What is the term in Java EE to describe an instance of theshoppingCart class?
(1 mark)
(b) Assume that the shoppingCart object needs to be made into anEJB, which can
be called remotely

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post