Professional Documents
Culture Documents
#include <windows.h>
#include <string>
using namespace std;
void
void
void
void
void
void
void
void
void
void
menu();
login();
display();
aboutus();
speoffrs();
onscrnhlp();
cinform();
disply(string num);
inputdata(void);
Quit();
// Record structure
struct course
{
string cid;
string cnam;
string cstart;
int fee;
string cduration;
}carry[3];
// Main Program of the Student Information System
void main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
cout << "
*
*
"
<< endl;
cout << "
**
** "
<< endl;
cout << " *** Welcome to the Woodman Furniture customer order system **
**" << endl;
cout << "
**
** "
<< endl;
cout << "
*
* " <
< endl;
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
login();
system("pause");
}
/* Login program of the system.
In this login program users and the adminstrator can login to their programs sep
arately. */
void login()
{
string username, password;
int counter = 3;
do
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
cout << "<<<>>> Customer order login system <<<>>>" << endl;
cout << "\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Enter your username:";
cin >> username;
cout << "\n";
cout << "Enter password:";
cin >> password;
cout << "\n";
if ((username == "gajenthran") && (password == "gajen"))
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
10);
cout << " login Succeed" << endl;
cout << "\n";
break;
cout << "\n";
}
else if ((username == "administrator") && (password == "admin"))
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
10);
cout << "Administrator login Succeed" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
15);
cout << "\n";
inputdata();
cout << "\n";
char opt;
cout << "Do you want to log out y/n:" << endl;
cin >> opt;
cout << "-------------------------------------------------------------------------" << endl;
if (opt == 'y')
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_
HANDLE), 9);
login();
}
else
{
inputdata();
}
cout << "\n";
break;
cout << "\n";
}
else
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
12);
cout << "Accesss Denied....Invalid user name & password"
<< endl;
cout << "\n";
}
counter--;
} while (counter>0);
if (counter == 0)
{
cout << "\n";
cout << "\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "You are unauthorized person" << endl;
cout << "\n";
}
else
{
menu();
}
}
/* Main Menu program of the system.
Users can select options in this main menu according their purposes. */
void menu()
{
cout << "-------------------------------------------------------------------------" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
cout << "<<<>>> WOOD FURNITURE OPTIONS <<<>>> " << endl;
cout << "\n";
bool quit = false;
char option;
display();
while (quit == false)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Select 1,2,3,4,5 or 6 to quit" << endl;
cin >> option;
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
switch (option)
{
case '1':SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE)
, 11);
cout << "(()) About Us (())" << endl;
cout << "\n";
aboutus();
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
break;
'
'
'
'
<<
<<
<<
<<
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "********************************************" << endl;
cout << "* * * * * * * * * * * * * * * " << endl;
cout << "*
Customer Order System
*" << endl;
cout << "--------------------------------------------" << endl;
cout << "*(1. About Us
)*"
cout << "\n";
cout << "*(2. List Special Offers
)*"
cout << "\n";
cout << "*(3. List Available Courses
)*"
cout << "\n";
cout << "*(4. Search Specific Items or Category information )*"
cout << "\n";
cout << "*(5. On Screen Help
)*" << endl;
cout << "\n";
cout << "*(6. Exit
)*" << endl;
cout << "*
*" << endl;
cout << "* * * * * * * * * * * * * * * " << endl;
cout << "********************************************" << endl;
cout << "\n";
}
//Quit function
void Quit()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
char opt;
cout << "Do you want to Exit from the system y/n:" << endl;
cin >> opt;
if (opt == 'y')
{
exit(1);
}
else
{
menu();
}
}
<< endl;
<< endl;
<< endl;
<< endl;