Question: Using the template and the assumed values ( product = milk, productType = P; purchasePrice = 455.25 ) given complete the trace table for the

Using the template and the assumed values ( product = "milk", productType = P; purchasePrice = 455.25 ) given complete the trace table for the pseudocode below (20 marks)

Using the template and the assumed values ( product = "milk", productType

TRACETABLE assumed values ( product = "milk", productType = P; purchasePrice = 455.25 ) Steps statements Notes product productType purchasePrice markup IF productType == 'P' IF productType == 'N' sellingPrice PRINT

1. DECLARE product AS INTEGER

2. DECLARE productType AS CHARACTER

3. DECLARE purchasePrice, sellingPrice, markup AS REAL

4. PRINT Please enter product:

5. READ product

6. PRINT Please enter product type (P)erishible (N)on-perishable:

7. READ productType

8. PRINT Please enter product purchase price:

9. READ purchasePrice

10. IF productType == P

11. markup = 0.05

12. IF productType == N

13. markup = 0.15 14. sellingPrice = purchasePrice * (1.0 + markup) 15. PRINT product, marked up by, markup, suggested selling price, sellingPrice

DECLARE productSku AS STRING DECLARE productTYPE as CHARACTER DECLARE purchasePrice, sellingPrice, markup AS REAL PRINT "Please enter product:" READ productSku PRINT "Please enter product type (P)erishible (N)on-perishable:" READ productType PRINT "Please enter product purchase price:" READ purchasePrice IF productType == ' P ' THEN Markup =0.05 ENDIF IF productType == ' N ' THEN Markup =0.15 ENDIF sellingPrice = purchasePrice (1.0+ markup ) PRINT product, "marked up by", markup, "suggested selling price", sellingPr

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!