Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • General programming »
  • I have a school test in c++
« previous next »
  • Print
Pages: [1]

Author Topic: I have a school test in c++  (Read 3319 times)

Offline maxine

  • Average scripter
  • Zealot
  • *
  • Posts: 736
  • ¨Dude i am 16 with 2 balls and hair
I have a school test in c++
« on: October 28, 2005, 07:07:34 PM »
Ok school test in computer programming is coming up. I know for sure a question will be "Show an example how to use a while loop".. So i will put up a simple math test with a while loop, and perhaps someone can find any compiling error in it.

//While loop
#include
using namespace std;

int main()
{        
        double answer1;
        do{
        cout << "what is 5 + 5: " ;
        cin >> answer1;
        if (answer1 == 10){
            cout << " " << endl;
            cout << "Its correct" << endl;
        //Here its supposed to go too question number 2 etc.
            }
        else{
               cout << " " << endl;
               cout << "Wrong go to the beginning" << endl;
               cout << " " <               }
       }while (answer1 <10 || answer1 >10);
       cin.ignore(1000,'\n');
       getchar();
       return 0;
}

i make the cout << " " << endl; to make new rows, thats just my way of doing it. And i would like too know if some1 dosent get it too work. My DEVCPP is currently not available for me since i am not at that computer and i wont be untill after the test. So i would aprreciate if some1 tested this or see anything wrong right here =). The program is supposed to say"Correct" if you put the right answer and go to the beginning if you are wrong.

Cheers*

Logged
Frontline Fighters Platoon Multigaming Clan

Offline Drighton

  • Acolyte
  • *
  • Posts: 419
(No subject)
« Reply #1 on: October 28, 2005, 07:11:03 PM »
I don't see anything wrong about it. Looks good.
Logged

Offline maxine

  • Average scripter
  • Zealot
  • *
  • Posts: 736
  • ¨Dude i am 16 with 2 balls and hair
(No subject)
« Reply #2 on: October 29, 2005, 11:15:02 AM »
pheeew thank you for that. Now lets see what the test answers say ;)
Logged
Frontline Fighters Platoon Multigaming Clan

Offline Moosetroop11

  • Sage
  • *
  • Posts: 7,398
(No subject)
« Reply #3 on: October 29, 2005, 11:30:11 AM »
C++ in school? Cool.
Logged
Maaaaaaaaaaaaaaaaaaaaaaaaaaan I missed this place.

Quote from: drenrin2120
Maaaaaaaaaaaaaaaaaaan I missed you.

Quote from: fruckert
Maaaaaaaaaaaaaaan I missed that welcome.

Offline Drighton

  • Acolyte
  • *
  • Posts: 419
(No subject)
« Reply #4 on: October 29, 2005, 01:51:19 PM »
Quote
Originally posted by Moosetroop11
C++ in school? Cool.


What, you've never been?

Its great. I actually had a C++ Introductory class, and then an advanced C++ class, then an "Independant Study" class (play around on the computer). That teacher ROCKED :D
Logged

Offline maxine

  • Average scripter
  • Zealot
  • *
  • Posts: 736
  • ¨Dude i am 16 with 2 balls and hair
(No subject)
« Reply #5 on: October 30, 2005, 07:39:43 PM »
Quote
Originally posted by Moosetroop11
C++ in school? Cool.


Yeah it owns so damn hard. But we only have A and B course.
But you know c++ moosetroop dont you?
Logged
Frontline Fighters Platoon Multigaming Clan

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • General programming »
  • I have a school test in c++
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum