Anyone? I can't wait til this class is over >____>
Here's my code:
#include <iostream> #include <string> using namespace std; int main() { string item[100]; string search; int calories[100]; int i = -1; do { i++; cout << "Enter a menu item (enter 'done' when finished): "; getline(cin,item[i]); if (item[i] != "done") { cout << "Enter the number of calories: "; cin >> calories[i]; cin.ignore(); } }while (item[i] != "done"); cout << "HERE IS THE SORTED DATA:" << endl; // display all inputs here, sorted using a bubble sort. cout << "NOW YOU CAN SEARCH FOR DATA:" << endl; }
Edited by Supernature, 03 August 2010 - 02:42 PM.