Thread: small misunderstanding please help

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    61

    small misunderstanding please help

    hello
    i am doing a student regis course portal in data struc c++
    and i want to do first a condition of
    student with certain matric no's enter in specific time entered by the user..


    now i am getting trouble with the condition for the time inputed with the matric no
    to be more clear
    it's like this
    user input time now
    in 24 hours and
    matric number

    from 0800 to 1200 for matric number from

    073xxxx to 081xxxx
    amd from 2100 to 2400
    for 72xxxxx only.how???

    here's my intial code

    Code:
    
    #include <iostream>
    
    using namespace std;
    
    int main()                            // Most important part of the program!
    {
      int age,time;                            // Need a variable...
    
     cout<<"input the time now:";
     cin>>time;
      cout<<"Please input your matric number: ";    // Asks for age
      cin>> age;                          // The input is put in age
      cin.ignore();                       // Throw away enter
    
    if(( age >= 730000) && (age <  820000)){
    
    cout<<"You  may enter \n";
    cout<<"this is your period\n";
    
    }
    
      else if (( age <= 729999 ) && (age  >=  720000)){            // I use else just to show an example
         cout<<"You cannot enter\n";           // Just to show you it works...
      }
      else {
        cout<<"did you input properly????\n";     // Executed if no other statement is
      }
      cin.get();
    }

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    61
    nevermind
    already got this sort out..

    mod close this thread

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to split long programe in small files
    By umeshjaviya in forum C Programming
    Replies: 11
    Last Post: 04-15-2008, 02:45 AM
  2. Creating small executables
    By cloudy in forum C++ Programming
    Replies: 8
    Last Post: 05-25-2006, 01:17 PM
  3. want to make this small program...
    By psycho88 in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2005, 02:05 AM
  4. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 06:51 PM
  5. yhatzee, small straight
    By uglyjack in forum C++ Programming
    Replies: 2
    Last Post: 06-13-2002, 03:09 AM