Volume of truncated cone app calculator

hi i need mit app to calculate volume of trancated cone

Here is your formula:

V = (1/3) * π * h * (r² + r * R + R²),

Where:

R is the radius of the base of the original cone (bottom surface);
r is the radius of the top surface; and
h is the height of our truncated cone.

image

Use Maths blocks

1 Like

How do you insert the formula in the block please

https://ai2.appinventor.mit.edu/reference/blocks/math.html

This should do it:

image

Screen design,how will it look like?

What about user interface of the app

What about it? The world is your oyster...

Use textboxes to enter the various values, a button to call the formula, and a label to display the result.

Do it like your cone calculator from here

and name the app this time "truncated cone volume app calculator for dummies"

Taifun

1 Like


clear.cache

if i try to calculate is giving me an errors on RADIUS

What is the exact error message?

My guess is, you have the same issue as in your other thread...

and remember, you only can calculate with numbers... it might be a good idea to initialize yout textboxes RADIUS and HEIGHT with the initial value 0 (rather than RADIUS) and set the numbers only property of the textboxes to true to avoid someone typing in an alphanumeric value..

Taifun

Use the blue mutator button to add another else if branch to allow you to test the third number like you did the first two.


This the error am getting.


This is user interface

Like so:

all textboxes set to 0, and NumbersOnly on initialise

this block is giving me 3.142111 whenever input any values of radius,RADIUS and height.

You need to use the procedure input block

image

am unable to that procedure on procedure bar

You have created a procedure called "procedure" - change the name to something more meaningful like "VolTruCone"

Click on Procedures in the palette on the left to reveal your "procedure" input block


Has no input