Documente Academic
Documente Profesional
Documente Cultură
#Prerelease2016
DECLARE Content: Char
DECLARE Weight: Real
PRINT Enter content of sack
READ Content
IF Content = C
THEN
>=25.1:
OTHERWISE:
ENDCASE
ELSEIF Content =S OR G THEN
PRINT weight of the sack
READ Weight
CASE OF Weight
<=49.9:
>=50.1:
OTHERWISE:
ENDCASE
ELSE
PRINT Sack is rejected due to invalid content
ENDIF
READ SOrder
TOrder = COrder + SOrder + GOrder
WHILE CDeliver < COrder OR SDeliver < SOrder OR GDeliver < GOrder DO
PRINT Enter content of sack to deliver
READ Content
IF CDeliver < COrder AND Content = "C" THEN
PRINT Enter weight of sack of cement
READ Weight
CASE OF Weight
<=24.9, >=25.1:
CountRejected CountRejected + 1
OTHERWISE:
ENDCASE
ELSEIF GDeliver < GOrder AND Content = "G" THEN
PRINT Enter weight of sack of gravel
READ Weight
<=49.9, >=50.1:
CountRejected CountRejected + 1
OTHERWISE:
ENDCASE
CountRejected CountRejected + 1
OTHERWISE:
ENDCASE
ELSE
CountRejected CountRejected + 1
PRINT Rejected due to completed order or invalid content
ENDIF
ENDWHILE
PRINT "Total Rejected " ,CountRejected
PRINT"Total weight delivered " , TWeight)
Module
/04