no the do while is correct you dont need to ask the first time through the loop.
i would still say just make some char and at the end do a
char = getch();
and for a condition just make sure it doesnt == n or N
no the do while is correct you dont need to ask the first time through the loop.
i would still say just make some char and at the end do a
char = getch();
and for a condition just make sure it doesnt == n or N
well at any rate, I'm going to take the info you guys have given me and see if I can't make a go of it. If it still doesn't work, guess I'm come ask for somemore help. Thanks again.
Code:#using <mscorlib.dll> #include <stdlib.h> #include <iostream> #inlcude <conio> using namespace std; using namespace System; int main() { double a = 0; double b = 0; double c = 0; double d = 0; double Average = 0.0; String *anotherAverage = ""; Boolean Y = 1; Boolean N = 0; char temp; do {system("CLS"); Console::Write("Enter first number: "); a = Convert:: ToDouble(Console::ReadLine()); Console::Write("Enter second number: "); b = Convert::ToDouble(Console::ReadLine()); Console::Write("Enter third number: "); c = Convert:: ToDouble(Console::ReadLine()); Console::Write("Enter fourth number: "); d = Convert:: ToDouble(Console::ReadLine()); Average = a + b + c + d /4; Console::WriteLine("Average: {0}", Average.ToString("N2")); Console::Write("Do you want to get another average? (Y/N)"); temp = getch(); } while (temp != 'n' && temp != 'N'); cin.get(); //used for wait? return 0; } //end of main function
[QUOTE=~Kyo~][code]
#using <mscorlib.dll>
#include <stdlib.h>
#include <iostream>
#inlcude <conio> //I get a invalid preprocessor command on running it
lol, nevermind got it going. But still something fishing goin on, now nothing displays at all on screen. Well, guess I'll mess a bit before I go to bed. Thanks.
Last edited by Xeavor; 09-23-2004 at 11:27 PM.
<conio.h>
I have enough strange libs loaded into my msvc++ as long as I know the name it works =) conio or conio.h both seem to work for me but i got allegro and some other stuff in here too.
Got it to load up now...just trying to figure out why nothing displays but black screen now.
ok got it working, seems I had alot of uneeded stuff in there huh lol. Well anyways, thanks guys. Lots of help, guess I have lots and lots of more studying ahead of me huh? later.
this isn't complex code. you need to create a function. ill work one out in about 2 mins so ill post code when im done. you don't need the complex code you posted. i know you've fixed it but i feel like this