User Profile

Collapse

Profile Sidebar

Collapse
Geocool
Geocool
Last Activity: Oct 29 '10, 02:20 PM
Joined: Oct 11 '10
Location: Greece
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Code:
    if ( score > highscore )
        highscore = score;
    else if (score < lowscore )
        lowscore = score;
    Add the above code after "cin >> score;"

    You have declared lowerscore as 1 so if you enter 20 is bigger than your already given(1) lower score so it doesn't take it.

    I suggest to set first input as lowscore.
    like:

    Code:
    bool isfirstinput(true);
    while(!cin.eof()){
    ...
    See more | Go to post

    Leave a comment:


  • Well, what i did was to create a bool array and check every time if number was used in a while statement.
    Check bellow.
    _______________ _______________ ______________

    Code:
    #include <iostream>
    #include <time.h>
    
    using namespace std;
    
    const int MAX_NUM(26);
    
    class RANDOM_NUM{
    public:
        void CreateRandNum();
        void SetNumsUnused();
        bool CheckIfAllUsed();
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...