Testcover.com Testcover.com
Shopping Cart Example -
displayNonemptyCart() Pseudocode
Pseudocode for displayNonemptyCart() action on entry to the nonemptyCart state. Each item in the cart is displayed; the subtotal and the SHOP, UPDATE and CHECKOUT buttons are displayed.

displayNonemptyCart() {                                                        /* nonemptyCart entry */
    displayCartStart();
    subtotal=0;
    for(i=0; i<n; i++) {
        displayItem(delChk[i], item[i], desc[i], newQ[i], price[i], itemTotal[i]);
        subtotal+=itemTotal[i];
    }
    displaySubtotal(subtotal);
    displayButton(SHOP);
    displayButton(UPDATE);
    displayButton(CHECKOUT);
    displayCartEnd();
}
Copyright © 2003-2018 Testcover.com, LLC. All rights reserved.