prob2 HW1 - cream cone and store that value in a variable...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Areeje Khalek % 8/20/2009 10:36 AM % Prob2 of hw01 % Script Name: prob2 % Script Variables: % 1. amount (double) - Contains the amount of ice cream necessary to fill % an ice cream cone of the given dimensions % 2. time_to_fill (double) - The amount of time it takes to the fill an % ice cream cone, if each cone is filled at a rate of 1.4 in^3/s. % Answer should be in seconds. % % Problem Statement: % Write a script named "prob2" that will calculate the volume of ice % cream needed to fill an ice cream cone. The ice cream cone is 7 inches % tall and its rim has a diameter of 0.5 inches. Assume that the ice % cream completely fills the cone, and that the ice cream above the cone % is in the shape of a perfect hemisphere. Store the volume needed in a % variable called "amount". Also, assume that the cone is filled at a % rate of 1.4 in^3/s. Find the amount of time it takes to fill one ice
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % cream cone, and store that value in a variable called "time_to_fill". % % Note: Your answer should be in units of in^3. Don't convert to any % other unit of measurement such as ft^3, or yd^3. Also, don't forget to % include the hemispherical dome of ice cream above the cone. % % Knowns d = 0.5; % diameter of cone is .5 inches h = 7; % height of cone is 7 inches r = d ./ 2; % radius is ofc half of diameter rate = 1.4; % rate the ice cream is filled is euqal to 1.4 inches cubed per second r % Calculations % forumala for volume of cone and of hemisphere above cone coneVol = (1./3) .* pi .* r.^2 .* h; hemiSphereVol = (2./3) .* pi .* r.^3; h % total amount of ice cream is equal to volume of cone and hemisphere % above it amount = coneVol + hemiSphereVol; a % filling time is amount divided by rate time_to_fill = amount ./ rate;...
View Full Document

This note was uploaded on 10/22/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Tech.

Ask a homework question - tutors are online