Volume and surface area of cylinder , cone and resulting solids
case (1) cone is in side of cylinder
case (2) if cone on the cylinder

cylinder

volume of cone

Surface area of cone

case I

Case (2)

r = 1 (slider from 1 to 10, step 1)
A = (-0.5105843572973477, -2.8130727332549)
c = Circle(A, r)
B = (3.6475757275358798, -3.2626035532368727)
d = Circle(B, r)
h = 2 (slider from 1 to 10, step 1)
C = Point(c)
a, e, b = Cylinder(c, (-h))
f, g, i = Cone(c, (-h))
l: r^(2) + h^(2)
D = Point(d)
m, p, n = Cylinder(d, h)
o, q, s = Cone(p, h)
eq1: l^(2) = r^(2) + h^(2)
t, c_1, u = Cone(d, 0)
v, d_1, w = Cone(d, 0)
a_1, e_1, b_1 = Cone(q, 0)
f_1, g_1, h_1 = Cone(g, 0)
L: r + h^(2)
slantheight: sqrt(L)
sacyl: (((2 * π) * r) * h)
areabase: (π * r^(2))
tsacyl: areabase + sacyl
csacone: ((slantheight * π) * r)
tsacone: areabase + csacone
vcly: ((π * r^(2)) * h)
vcone: vcly / 3
text2: "volume of cylinder =  π r²h=" + vcly + "
cruved suface area of cylinder= 2 π rh=" + sacyl + "
total surface area of cylinder = 2 π r(r+h)=" + tsacyl + ""
text3: "" + text2 + ""
j = true
text4: "volume of cone = \frac{1}{3}volume of cylinder
 =\frac{1}{3}*" + (LaTeX[vcly]) + "=" + (LaTeX[vcone]) + ""
k = true
i_1 = true
case1v: vcly + vcone
case1sa: sacyl + csacone + areabase
case11v: vcly - vcone
text6: "Case I :- when cone inside of cylinder(conical cavity))
volume of resulting solid = volume of cylinder- volumeof cone
         =  " + vcly + " - " + vcone + "= " + case11v + " cubic unit
Total surface area of solid when conical cavity=
   CSA of cylinder + Csa of cone + area of base=
     " + sacyl + " + " + csacone + " +" + areabase + " = " + case1sa + " square unit"
j_1 = true
case2v: vcly + vcone
k_1 = true
E = (6.293544552871838, -1.7522694134015113)
F = (8.637098570828716, -1.7726481439924404)
G = (5.732433894002438, -5.474510300298942)
H = (9.431653414131237, -5.480490519684574)
text5: "Slant height = l =√(r²+h²) =" + slantheight + " unit
Cruved surface area=  π rl = " + csacone + " sq.unit
total surface area of cone =  πr(r+l)=" + tsacone + " sq. unit"
text7: "Case II :- when cone surmounted on cylinder
Total surface area = Csa of cylinder + Csa of cone+area of base =
                                     =" + sacyl + " + " + csacone + " + " + areabase + "  = " + case1sa + " squre unit
Volume of solid = volume of cylinder + volume of cone 
                              =  " + vcly + "  + " + vcone + " = " + case2v + "  cubic unit"