Professional Documents
Culture Documents
AoT 02 Structure Flowchart Assignment 1
AoT 02 Structure Flowchart Assignment 1
Assignment 1
2. What do the following flowcharts do? Write the Equivalent Python Code for the Same.
Treat each flowchart as a Function with its INPUT and OUTPUT. Name the function
appropriately once you figure out what it does. [Note: modulo(x, y) in python is x % y]
(a) (b)
(c) (d)
3. Draw the flow chart and implement the Python code for the following:
a) You are given a Sphere with radius sr and a Cone with radius cr and height ch. Write
a python function (def sphere_or_cone) and its flowchart to return true if Sphere
has a larger volume and false if Cone has a larger volume. What are the two input
types of this function (NOTE: Club the parameters of each shape together in a tuple)
b) You are given two cuboids P and Q. Cuboid P has dimensions (pl, pb, ph) and Cuboid
Q has dimensions (ql, qb, qh). Write a function and flowchart to return the volume of
that cuboid whose surface area is larger. What are the two input types of this
function (NOTE: You can club the parameters of each cuboid as a tuple)
Check that in all cases the final output is always (3, 2, 1).