tag:blogger.com,1999:blog-36721205722048005022024-02-20T18:30:37.403-08:00x-X'~'ULTRA'='DESTROY'~'X-xuLTRa DeSTRoY iS SW4RMC4T iNFo DuMPSWARMCAThttp://www.blogger.com/profile/08974787850500380124noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-3672120572204800502.post-90482452423619053872012-03-22T12:35:00.002-07:002012-03-23T15:35:55.115-07:00<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><span style="font-size: small;"><span style="font-family: inherit;">Here's an edit to the cafe cost program. Now includes labor, and gives cost per day/milk,espresso,and coffee needed based on a loop.</span></span> </span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<br /></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;">/*costs program by B0N354W*/<br /><br />#include <stdio.h><br /><br />#define BAGCOST 65.0<br />#define BAGSHOTS 250.0<br />#define MILKCOST 4.09<br />#define MILKOZ 128.0<br />#define SMALL 12.0<br />#define MEDIUM 16.0<br />#define LARGE 20.0<br />#define SCOFPB 150.0<br />#define MCOFPB 112.5<br />#define LCOFPB 90.0<br />#define LABOR 0.15<br />#define STARTUP 28280.0<br />#define MARKUP 2<br /><br />int main()<br />{<br /> float shotcost,slatte_pg,mlatte_pg,llatte_pg,slatte_mp,mlatte_mp,llatte_mp,slattecost,mlattecost,llattecost,scoffeecost,mcoffeecost,lcoffeecost,daycost,espressobags,coffeebags,gallons,profit;<br /> int lattepd,coffeepd,days,x,startup;<br /> float daycosts[19];<br /><br /> shotcost=BAGCOST/BAGSHOTS;<br /> slatte_pg=MILKOZ/(SMALL-1);<br /> mlatte_pg=MILKOZ/(MEDIUM-2);<br /> llatte_pg=MILKOZ/(LARGE-3);<br /> slatte_mp=MILKCOST/slatte_pg;<br /> mlatte_mp=MILKCOST/mlatte_pg;<br /> llatte_mp=MILKCOST/llatte_pg;<br /> slattecost=slatte_mp+shotcost+0.05+LABOR;<br /> mlattecost=mlatte_mp+shotcost*2+0.06+LABOR;<br /> llattecost=llatte_mp+shotcost*3+0.07+LABOR;<br /> scoffeecost=BAGCOST/SCOFPB+0.05+LABOR;<br /> mcoffeecost=BAGCOST/MCOFPB+0.06+LABOR;<br /> lcoffeecost=BAGCOST/LCOFPB+0.07+LABOR;<br /><br />/*cost per individual item*/ <br /> printf("\nINDIVIDUAL ITEM COSTS\n\n");<br /> printf("espresso shot: %.2f\n\n",shotcost);<br /> printf("small latte:%.2f\nmedium latte:%.2f\nlarge latte:%.2f\n\n",slattecost,mlattecost,llattecost);<br /> printf("small coffee:%.2f\nmedium coffee:%.2f\nlarge coffee:%.2f\n\n",scoffeecost,mcoffeecost,lcoffeecost);<br /> printf("With 300 percent markup\n");<br /> printf("small latte:%.2f\nmedium latte:%.2f\nlarge latte:%.2f\n\n",slattecost*3,mlattecost*3,llattecost*3);<br /> printf("small coffee:%.2f\nmedium coffee:%.2f\nlarge coffee:%.2f\n\n\n",scoffeecost*3,mcoffeecost*3,lcoffeecost*3);<br /><br />/*cost per day*/<br /> getchar();<br /> printf("DAY COST ESTIMATES\n\n");<br /> lattepd=0;<br /> x=0;<br /> for(coffeepd=20;coffeepd<=400;coffeepd+=20)<br /> { <br /> lattepd+=20;<br /> printf("lattes per day: %d\n",lattepd);<br /> printf("coffees per day: %d\n",coffeepd);<br /> daycost=(((scoffeecost+mcoffeecost+lcoffeecost)/3)*coffeepd)+(((slattecost+mlattecost+llattecost)/3)*lattepd);<br /> printf("COST PER DAY: %.2f\n\n",daycost);<br /> daycosts[x]=daycost;<br /> gallons=lattepd/((slatte_pg+mlatte_pg+llatte_pg)/3);<br /> printf("%.2f gallons of milk needed\n",gallons);<br /> espressobags=(lattepd*2)/BAGSHOTS;<br /> printf("%.2f 5lb bags of espresso needed\n",espressobags);<br /> coffeebags=coffeepd/((SCOFPB+MCOFPB+LCOFPB)/3);<br /> printf("%.2f 5lb bags of regular coffee needed\n",coffeebags);<br /> x+=1;<br /> printf("-------------------------------\n\n");<br /> }<br /><br />/*determining time till profitability*/<br /> getchar();<br /> printf("Days till profitability at different costs per day and 300 percent markup\n");<br /> for(x=0;x<=19;x++)<br /> {<br /> printf("for cost per day $%.2f: ",daycosts[x]);<br /> profit=daycosts[x]*2;<br /> startup=STARTUP;<br /> days=0;<br /> while(startup>=0)<br /> {<br /> startup-=profit;<br /> days+=1;<br /> }<br /> printf("%d days\n",days);<br /> }<br /> return(0);<br />}<br /></span></div>SWARMCAThttp://www.blogger.com/profile/08974787850500380124noreply@blogger.com0tag:blogger.com,1999:blog-3672120572204800502.post-16309407396227086502012-02-01T17:44:00.000-08:002012-02-01T17:44:38.970-08:00visit http://naboamusic.com<br />
search: EDN<br />
download "Isolator"<br />SWARMCAThttp://www.blogger.com/profile/08974787850500380124noreply@blogger.com0tag:blogger.com,1999:blog-3672120572204800502.post-83406240914977078432012-01-30T20:50:00.000-08:002012-01-30T20:50:39.013-08:00<span style="font-family: "Courier New",Courier,monospace; font-size: x-small;">/* DICE ROLLER*/</span><span style="font-size: x-small;"><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">#include <stdio.h></span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">#include <stdlib.h></span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">#include <time.h></span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">int rnd(int range);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">void seedrnd(void);</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">int main()</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">{</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> char ch;</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> </span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> int x,number,sides;</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> char temp[3];</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> </span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> printf("# of sides: ");</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> gets(temp);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> sides=atoi(temp);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> </span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> printf("# of dice: ");</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> gets(temp);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> number=atoi(temp);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> </span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> seedrnd();</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> for(x=0;x<number;x++)</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> printf("%d\t",rnd(sides));</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> return(0);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">}</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">int rnd(int range)</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">{</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> int r;</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> </span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> r=rand()%range;</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> return(r+1);</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">}</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">/*seed the random number*/</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">void seedrnd(void)</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">{</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;"> srand((unsigned)time(NULL));</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">}</span></span>SWARMCAThttp://www.blogger.com/profile/08974787850500380124noreply@blogger.com0