Again, thanks everyone for the input. :)
@sloppy9: Thanks for the advice, will definitely remove the if...else surrounding that loop.
@Moeljbcp: Thanks for that code. I was going to do that myself when I got home today, but I'll definitely fiddle around with that and see what I can do.
At this point, I'm really curious too. I can't imagine what in the main function could be causing this. The function userSaysYes() is only used in other functions called by main(). BUT, at this point, I'm just going to copy the whole of my main function, along with my includes, the works, just to make sure something doesn't get overlooked.
I'll mention again that the package
utilities.h
isn't source code, it's an .obj file, so I can only guess what's going on under the hood.
Anyway, here it is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
#include <iostream>
#include <cstdlib>
using namespace std;
#include "fraction.h"
#include "utilities.h"
using Scobey::DisplayOpeningScreen;
using Scobey::Menu;
using Scobey::Pause;
using Scobey::TextItems;
using Scobey::userSaysYes;
/*
do...while loops in compute and compare just keep executing.
Add opening screen to main().
Fully implement option 5.
*/
const TextItems TEXT("compute_with_fractions.txt");
// prototypes
Menu createMenu(Menu& menu);
void computeFractions();
void compareFractions();
void test();
int main()
{
int userChoice;
Menu fractionsMenu("Menu");
createMenu(fractionsMenu);
fractionsMenu.display();
userChoice = fractionsMenu.getChoice();
do
{
switch(userChoice)
{
case -1:
return -1;
break;
case 1:
return 0;
break;
case 2:
TEXT.displayItem("Program Description");
break;
case 3:
computeFractions(); // <-- The function in question!
break;
case 4:
compareFractions(); // <-- Also has the same problem
break;
case 5:
test(); // <-- Also uses same structure. Not complete.
break;
}
}
while(userChoice != 1);
}
|
Again, bear in mind that this is not completed code, but everything we need to look at is there.
So, if anything jumps out at you guys from that, here's hoping for a quick fix.
Also, if you really need to know anything about those functions from namespace Scobey I can give the documentation, but I don't think that should be an issue.
In the meantime, I'm going to keep messing around, and see what I can come up with.