Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

help Zamco\'s Discounts. Assume you have been asked to develop an algorithm to c

ID: 3809939 • Letter: H

Question

help

Zamco's Discounts. Assume you have been asked to develop an algorithm to calculate the discounts that apply to retail customer purchases from zamco's Department Stores. An example spreadsheet is given and described below There are two types of discounts: (1) when a store-wide sale is in effect for all customers (2) when a customer signs up for a Zamco credit card. In each case, a check is placed in the appropriate box in the spreadsheet to the right. When a discount-status box is checked it reflects that that discount applies (is True, in Boolean terms). When a discount-status box it reflects that that discount does not apply (is False, in Boolean terms). One or both discounts can be selected. Assume that your algorithm will assume that at least one discount will apply. So assume that at least one discount will apply when this process is used. The Store wide Discount Rate (SDR) and the Credit Card Signup Discount Rate (CDR) are also stored in the setup section. The Pre-discount Total Amount (PDT) is input for each sale. The manager adds a checkmark to the Setup section for the storewide discount for days when the discount applies before the store opens, so it only needs to be done once for the entire day; that way, the clerk does not have to do this. The clerk adds a check mark if the customer has signed up for a store credit card. The table below shows which discounts apply in three different discount scenarios: When you design your flowchart, assume that the variables SDStatus, and CDStatus are Boolean variables (They can only be True or False). In Scenario 1, only the storewide sale discount is given. In scenario 2, only the credit-card sign-up discount is given. In Scenario 3, where both discounts apply, the storewide sale discount amount is calculated first and subtracted from the original total to create a subtotal. Next, the credit-card discount amount is calculated on the subtotal from the storewide discount. Thus the discount amount for the credit-card signup is different when the storewide sales discount applies. The examples below show the discounts applied to a $100 Pre-Discount Total (PDT) for each of the three scenarios, assuming that the storewide sale discount rate is 10% and the credit-card sign-up discount is 20%.

Explanation / Answer

Hello ,

Below is the algorithm to calculatethe discount for the above mentioned scenarios:-

Necessary comments have been provided to understandthe algorithm.Please find the algorithm below:-

ZAMCODISCOUNT ALGORITHM:-

//The algorithm is to calculate the total discount given on each sale depending upon the customer choice of credit card sign up or not.

//The algorithm takes pre discount total PDT which is total sale; CDStatus i.e. credit card sign up status, SDStatus i.e. Store wise discount status, CDR, SDR which are credit card discount amount and store wise discount amount respectively. Last variable is Grand Total which is post discount total

Begin algorithm ZamcoDiscount

{

      Step 1:- Input PDT, SDStatus, SDStatus, SDR, CDR, Grand_Total

      //manager sets the SDStatus;

     Step 2:- SDStatus =1;

     //The pre defined discounted values are also set

     Step 3:-Set SDR =0.1, Set CDR = 0.2;

    //Check whether the customer signed up for the credit card option or not

    // If yes then apply both discount and then display a Grand_Total else give only SDR and display

// Grand_ Total

      Step 4:- Check whether customer signed up for credit card

                If customer signed up for credit card

                   {  

                       Set CDS = 1;

                        Display (CDR *100);

                        Display (SDR*100);

Grand _Total= (PDT -(PDT-(PDT*SDR))*CDR);

                         Display Grand_ Total;

                    }

                 Else

                    {

                     Display SDR;

Grand_ Total = (PDT-(PDT*SDR));

Display Grand_Total;

}

} end algorithm ZamcoDiscount