in line 55 and 73 i use return 0; which should end that call fuction. here is the thing i dont get. if the call function successfully end, then why 0.00 show up? could anyone offer me an explanation or a way to fix so that 0.00 wont show up? thx
Try eliminating lines 22 and 27.
I'm surprised that line 17 ever lets you into the while loop. Did you mean to use || instead of && ?
If it were written like this while ( (choice == 1) && (choice == 2) ); then surely the loop would never be entered.
do
{
cout << "1. Convert F to C" << endl;
cout << "2. Convert C to F" << endl;
cout << "What is your choice?" << endl;
cin >> choice;
} //this is a do while loop
while (choice == 1 && choice == 2);
{ //random scope entry
1. Line 17, why not have; while (choice != 1 && choice != 2); this would then eliminate the need for lines 30-35. If you wanted to warn user re; input you could put if (choice != 1 && choice != 2) {cout<<"Invalid input, try again!\n";}
before line 17, ie; before the } while (choice != 1 && choice !== 2);
2. Line 36, change system ("pause") to cin.ignore().get();
(A safer replacement!)
3. Line 18 and 29 not sure why curly braces here??
4. Youve got #include <iostream> twice at top of code??
5. The 0.00 is occurring because of the for loop line 50. Why is a for-loop
being used for this calculation?