22 lines
463 B
C++
Raw Normal View History

2021-02-19 12:06:26 -05:00
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main() {
int people;
int numPizzas;
double cost;
/* Type your code here. */
//people eat two slices each
// Pizza has 12 slices
// costs 14.95 each
cost = 14.95;
cin >> people;
numPizzas = ceil((2 * people)/12.0);
cout << "Pizzas: " << numPizzas << endl;
cout << "Cost: $" << fixed << setprecision(2) << cost*numPizzas << endl;
}