#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include "vectorUtils.h"
usingnamespace std;
// Compute the number of calories in one serving of a recipe
void computeCalories (constchar* nutrientFileName, constchar* recipeFileName);
int main (int argc, char** argv)
{
if (argc != 3)
{
cerr << "Usage: " << argv[0] << " nutrientFile recipeFile" << endl;
return -1;
}
computeCalories (argv[1], argv[2]);
return 0;
}
// Compute the number of calories in one serving of a recipe
void computeCalories (constchar* nutrientFileName, constchar* recipeFileName)
{
string file, file2;
ifstream inFile;
cout << "Please enter the nutrient file name\n";
cin >> file;
cout << endl;
inFile.open(file.nutrientFileName);
if (!inFile)
{
cout << "bummer file name \n\n";
}//open first file/ read
ifstream inFile2;
cout << "Please enter the recipe file name\n";
cin >> file2;
cout << endl;
inFile2.open(file2.recipeFileName);
if (!inFile2)
{
cout << "bummer file name \n\n";
}//open 2nd file/ read
int howmany, howmany2;
howmany=0;
howmany2=0;
//compare two data sets
for (int ir=0; ir<=howmany2; ir++)//loop through ingredients (inside recipes)
{
for (int in=0; in<=howmany; in++)//look for corresponding ingredients in nutrients
{
}
}
//if found, add calories found times amount
//if not found, set all flag to false/no
//divide total calories by serving size
//print recipe name
}
that's everything I have
just kinda been messing around with it
and remove all of the stuff in your method asking the user to input anything. the other doesn't have to input anything because the input is coming from the command line.