View Single Post
Old 05-10-2007, 03:07 PM   #306 (permalink)
Glen Apayart
Right Off the Assembly Line
 
Glen Apayart's Avatar
 
Join Date: Sep 2007
Location: Philippines
Posts: 5
Default Re: Post ur C/C++ Programs Here

My brother always use my admin account because i leave my pc on sometimes when im away or sleeping for a while.

So, I made a simple conditional statement for my brother to be reminded about the account he is using. By changing the icons of my .exe from his favorite game icon. hehe

Code:
#include <iostream>
using namespace std;

int main()
{
    char Ans;

    cout << "Hello!\n";
    cout << "The program you have choosen has been disabled by the admin,\n";
    cout << "Please use your own account,\n\n";

    do{
    cout << "do you want to exit (y/n)? ";
    cin >> Ans;

        if(Ans == 'n' || Ans =='N')
            cout << "Could you please leave me now...\n\n";
        else if(Ans == 'y' || Ans == 'Y')
            break;
        else
            cout << "Invalid Entry!\n\n";
    }
    while(Ans != 'y' || Ans != 'Y');
        system("cls");
        cout << "Thank you!" << "\n\n";
        cout << "Press any key to exit...";

    return 0;
}
__________________
Deitel: http://wps.prenhall.com/esm_deitel_chtp_4/
FunctionX: http://www.functionx.com/index.htm
Glen Apayart is offline