Finding the most efficient way to be a college student during the summer

Throughout the course of my stay at Stevens, I’ve found that, as a college student, one of the most important things to know (if not the most important thing) is where and how I’m going to get my next pizza.

In a normal semester, there are many events run by student organizations, clubs, and the like, where each use part of their budget to get some pizzas to attract more people to their events. This is the most cost-efficient way to obtain pizza (short of someone finding some way to get paid to eat pizza (I’m all ears–if you’ve heard of anything like this, please comment)). It’s also good because the pizzas often come from one of the many fine pizza restaurants in Hoboken.

The second-most efficient method relates to the dreaded meal plan. Any student here living in on-campus housing that doesn’t have a kitchen in his or her room, with certain exceptions, has to be on the meal plan. The meal plan has you pay a constant price up front for an “unlimited” number of times to be let in to the dining hall. The dining hall has an all-you-can-eat buffet, with pizza and various other foods (that rotate day to day). The pizza is okay, I certainly don’t expect to hold it up to proper Hoboken Italian restaurant standards; that would be rather ridiculous to expect of a campus dining hall. But if it’s already been paid for, cashing in on the meal plan is a viable method by which to acquire pizza.

Unfortunately, there’s not always a free-pizza event going on, especially during the summer. Worse yet, the dining hall is closed during the summer. This means the pizza money has to come out of my own pocket. There are many places to choose from here, and I need to determine how I can get the most pizza for the least amount of money. So, I wrote a small, trivial application in C++ (which should be understandable to beginners) that compares an arbitrary number of pizza places based on the amount of pizza you get for the price you pay (per slice).

#include <algorithm> // for sort()
#include <iostream> // for simple i/o
#include <cstdlib> // this is really only here for aesthetic purposes
#include <vector> // nicer to use than arrays, especially with stl algorithm
#include <cmath> // for M_PI

struct pizza_attribs {
	int num;  // index so we know who's the best after sorting
	int slices;  // the number of pieces, not the number of cuts.
	float diameter; // width of the pie
	float slice_cost;  // slice price
	float bang_for_buck;  // = (slice area)/price
};

using namespace std;

bool pa_compare(pizza_attribs a, pizza_attribs b) {
	return a.bang_for_buck > b.bang_for_buck;
}

int main() {
	vector<pizza_attribs> pa_list;
	int count;

	cout << "Be consistent with your units!" << endl << endl;
	cout << "How many places to compare? ";
	cin >> count;
	for(int i = 0; i < count; ++i) {
		pizza_attribs pie;

		pie.num = i;
		cout << "[pizza place #"<<i<<"] Price of a slice of pizza? ";
		do { cin >> pie.slice_cost; } while(pie.slice_cost <= 0);
		cout << "[pizza place #"<<i<<"] Number of slices in a pie? ";
		do { cin >> pie.slices; } while(pie.slices <= 0);
		cout << "[pizza place #"<<i<<"] Diameter of the pie? ";
		do { cin >> pie.diameter; } while(pie.diameter <= 0);

		pie.bang_for_buck = ((M_PI*pow(pie.diameter/2, 2))
		                     / pie.slices) / pie.slice_cost;

		pa_list.push_back(pie);
		cout << endl;
	}

	sort(pa_list.begin(), pa_list.end(), pa_compare);

	cout << "The results are in!" << endl;
	for(int i = 0; i < pa_list.size(); ++i) {
		cout << "[pizza place #"<<pa_list[i].num<<"] bang for buck: "
		  << pa_list[i].bang_for_buck/pa_list[0].bang_for_buck << endl;
	}

	return 0;
}

For example, the two closest pizza places to me right now are Benny Tudino’s and H&S Giovanni’s. Benny’s slices are taken from a 28-inch pie, sliced into 8 pieces, and cost $3.00 apiece. Gio’s slices are taken from a 22-inch pie, sliced into 8 pieces and cost $3.00 apiece (one can already intuitively figure out that you’d get more pizza from Benny’s). According to this program, you get an estimated 61.7% of the pizza at Gio’s that you would at Benny’s.

Now, this program makes some unreasonable assumptions: Namely, it assumes that all pizzas are of the same thickness, and it doesn’t factor in how good the pizza tastes. However, it makes objectively comparing pizza slices by area versus price a little bit easier.

TODO: Factor in distance to restaurant?

Advertisement

5 Responses to Finding the most efficient way to be a college student during the summer

  1. Amanda says:

    I enjoyed the program you made for this post about Pizza. Do factor in restaurant distances into it. =] You’re a great blogger hun. :)

  2. Helen says:

    How much extra for pepperoni?

  3. navaburo says:

    I believe the pizza should be judged as pragmatically as possible: in calories per dollar. This can factor in the thickness as well as the distance to the restaurant (subtract calories burned in walking).

    I once asserted that a tuna roll from Aroma was a better deal, calorie-wise, than was a slice of pizza from Gios. If your software ever expands to handle this sort of problem, do tell!

    -merck

    • madcs says:

      That probably makes the most sense, it didn’t occur to me that the calorie information was available for these restaurants. Perhaps I’ll do something like that in Python next.

    • FunkeyPhysicsMonkey says:

      The problem with using calories is that not all foods high in calories are filling, just look at butter and oil. The most filling foods are usually high in protein and/or fiber (although most carbs are filling, fiber has been shown to be the most filling). Also the volume of food and drink is important (like at aroma you get unlimited free water and they fill up you glass quickly) and how quickly your body processes that volume of material. Well I think now I’m are getting to complicated because some facts may not be obtainable, but instead of calories (since you can usually get carbs and protein from places that offer calories) you can have the program add the % daily value of protein and the % daily value of carbs (minimum daily value for a 2000 food calorie diet and assuming 1% or protein is just as filling as 1% of carbs) and divide that by the cost so you can know which food is the most filling per dollar.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.