You are on page 1of 3

Task 3 Solution (Pseudocode)

DECLARE shape, color, quality: STRING


DECLARE choice, depth, diameter: INTEGER
DECLARE volume, price, totalvolume, grey_price: FLOAT
CONST batch_size: INTEGER
CONST pi, setupcost: FLOAT

shape “ ”
color “ “
choice 0
depth 0
diameter 0
batch_size 20
volume 0.0
totalvolume 0.0
price 0.0
grey_price 0.0
pi 3.142
setupcost 5

INPUT “Enter the concrete price for 100000 mm”, grey_price


INPUT “Enter the quality grade of concrete. Basic or best”, quality

WHILE quality <> “basic” AND quality <> “best” THEN


PRINT “Wrong input given”
INPUT “Enter the quality grade of concrete. Basic or best”, quality
ENDWHILE

IF quality = “best” THEN


grey_price grey_price * 0.07
END IF

Sir Mym (0332-3033505) Sir Bandeshah (0333-2076121)


INPUT “Enter Shape of slabs. Square, rectangle or round”, shape

IF shape = “square” THEN


INPUT “Select choice for square sizes. 1 for 600x600 2 for 450x450”, choice
CASE choice OF
CASE 1: volume = 600*600
CASE 2: volume = 450*450
OTHERWISE: OUTPUT “Wrong Choice”
ENDCASE

ELSE IF shape = “rectangle” THEN


INPUT “Select choice for rectangle sizes. 1 for 600x700 2 for 600x450”, choice
CASE choice OF
CASE 1: volume = 600*700
CASE 2: volume = 600*450
OTHERWISE: OUTPUT “Wrong Choice”
ENDCASE

ELSE IF shape = “round” THEN


INPUT “Select choice for circle diameter. 1 for 300 2 for 450”, choice
CASE choice OF
CASE 1: volume pi * (300 / 2) ^ 2
CASE 2: volume pi * (450 / 2) ^ 2
OTHERWISE: OUTPUT “Wrong Choice”
ENDCASE

ELSE
OUTPUT “Wrong shape selected”
END IF

INPUT “Enter the depth of slab. 38 or 45”,depth


IF depth = 38 OR depth = 45 THEN
volume volume * depth
ELSE
OUPUT “Wrong depth selected”
END IF

totalvolume volume * batch_size

Sir Mym (0332-3033505) Sir Bandeshah (0333-2076121)


INPUT “Enter color of slab. Grey, red, green or custom”, color

CASE color OF
CASE “grey”: price (totalvolume / 100000) * grey_price
CASE “red”: price (totalvolume / 100000) * grey_price * 0.1
CASE “green”: price (totalvolume / 100000) * grey_price * 0.1
CASE “custom”: price ((totalvolume / 100000) * grey_price * 0.15) + setupcost
OTHERWISE: OUTPUT “Wrong Color Selected”
ENDCASE

IF shape = “square” THEN


IF choice = 1 THEN
OUTPUT “ Shape: Square, size: 600x600 ”
ENDIF
IF choice = 2 THEN
OUTPUT “ Shape: Square, size: 450x450 ”
ENDIF
ENDIF

IF shape = “rectangle” THEN


IF choice = 1 THEN
OUTPUT “ Shape: Rectangle, size: 600x700 ”
ENDIF
IF choice = 2 THEN
OUTPUT “ Shape: Rectangle, size: 600x450 ”
ENDIF
ENDIF

IF shape = “round” THEN


IF choice = 1 THEN
OUTPUT “ Shape: Round, Diameter: 300 ”
ENDIF
IF choice = 2 THEN
OUTPUT “ Shape: Round, Diameter: 450 ”
ENDIF
ENDIF

OUTPUT “ Depth :”, depth


OUPUT “Color: “, color
OUPUT “Price:”, price

Sir Mym (0332-3033505) Sir Bandeshah (0333-2076121)

You might also like