Volume of truncated cone app calculator

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

You did not add any inputs...

image

Click on the small blue square to add them, like in my image.

You also failed to call the procedure.

Here is my aia project

truncatedConeCalc.aia (2.8 KB)