#include
using namespace std;
int main()
{
double radius
double area
double slices
double slicarea
cout << "What is the radius of your pizza?" << endl;
cin >> radius;
area = 3.14 * radius * radius;
cout << "The area of your pizza is: " << area << endl;
cout << "So How many slices do you want?" << endl;
cin >> slices;
slicarea = area / slices
cout << "This is the area of the number of slices you wanted: " <<
slicarea <<endl;}
double area(double);
double cost(double,double);
double area (double radius)
{
return radius * radius * 3.14;
}
double cost (double area, double price)
{
return price / area;
}
int main()
{
double radius;
double pizza_area;
double price;
double pizza_cost;
cout << "What is the radius of your pizza pie?" << endl;
cin >> radius;
pizza_area = area (radius);
cout << " The area of your pizza is! " << pizza_area << endl;
cout << "What is the total price of your pizza pie?" << endl << endl;
cin >> price;
pizza_cost = cost (pizza_area, price);
cout << "This is the cost per square inch of your pizza" << pizza_cost
<<
endl;
return;
}
![]() |
QUETZALANDIA | ||
| Visual Basic | |||
| HOME :: BUSINESS :: COMPUTING :: LIFESTYLE :: PASTIME :: | |||
| There are more than 200+ different programming languages. There is a website who has entered the program "99 Bottles of Beer" in a 1000 languages.: http://99-bottles-of-beer.ls-la.net cool stuff |
|||