SHARE
TWEET

Untitled

a guest Jun 16th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module shoppingCart{
  2.     struct Product{
  3.         long productId;
  4.         string productName;
  5.         double productPrice;
  6.     };
  7.  
  8.     struct ProductOrder {
  9.         long productOrderId;
  10.         Product product;
  11.         double productQuanity;
  12.     };
  13.     typedef sequence<Product> ListOfProducts;
  14.     typedef sequence<ProductOrder> Orders;
  15.     struct Cart {
  16.      Orders orders;
  17.     };
  18.  
  19.     interface Shop {
  20.         ListOfProducts showAvailableProducts();
  21.         Cart createNewCart();
  22.     };
  23.  
  24.     interface CartManager {
  25.         Cart createNewCart();
  26.         boolean addToCart(in ProductOrder productOrder);
  27.         boolean removeFromCart(in ProductOrder productOrder);
  28.         boolean checkOutCart();
  29.     };
  30. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top