Re: enmergeny question!!


[ Follow Ups ] [ Post Followup ] [ Digital Reference Message Board ] [ FAQ ]

Posted by Suzanne Chan (192.168.0.102) on September 16, 2000 at 23:26:57:

In Reply to: enmergeny question!! posted by kevin on September 12, 2000 at 21:23:12:

Hi, Kevin!

Given the pizza's diameter and price, to calculate the price per square inch, you may do the following:

First calculate the area of the pizza. The radius is equal to the diameter divided by two. Pie is about 3.14. Therefore, the area is equal to 3.14*(d/2)*(d/2). (That is equivalent to pie times radius squared.) Now take the total price of the pizza and divide that by the area of the pizza. Then, you will have the price per square inch. For example, let's say the total price of the pizza is $100.99, if you want to output the price per square inch of the pizza, you may do the following:

double totalprice = 100.99;
double area = 3.14*(d/2)*(d/2);

cout << totalprice/area;

I hope I am of some help to you. Please come back again if you need some advice, and please tell your classmates about Digital Reference.

Thank you for contacting Digital Reference! Good Luck in your program!

Sincerely,

Suzanne Chan
Digital Reference, Team C008294 Member



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject: Re: Re: enmergeny question!!

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Digital Reference Message Board ] [ FAQ ]