Expand|Select|Wrap|Line Numbers
- #include <iostream>
- #include <string>
- int main()
- {
- using namespace std;
- char response[256];
- float ei = 0;
- float tf = 0;
- float ins = 0;
- float pj = 0;
- int y = 0;
- int n = 0;
- int i = 0;
- int e = 0;
- int t = 0;
- int f = 0;
- int in = 0;
- int s = 0;
- int p = 0;
- int j = 0;
- int awnser = 0;
- cout <<" This is a personality test commonly called the Jung/Briggs-Meyer\n";
- cout <<" personality test. You will be asked questions in which you are required\n";
- cout <<" to answer Yes(y) or No(n) as the question applies to you. The answer you\n";
- cout <<" give is the one that most applies to you, even if you agree with niether\n";
- cout <<" Would you like to take the personality test? select 1 for yes 2 to exit. ";
- cin.getline(response,256);
- if (strlen(response) == 0) {
- cout <<"Please make a selection ";
- return 1;
- }
- while ((atoi(response) < 1) | (atoi(response) > 2)) {
- cout <<response<<" - is an invalid selection.";
- return 1;
- }
- if (atoi(response) == 1) {
- cout <<" 1. You are alomst never late for your appointments. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = j++;
- else
- if (awnser == 'N'|| 'n')
- n = p++;
- cout <<"2. You like being engaged in an active and fast paced job. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = e++;
- else
- if (awnser == 'N'|| 'n')
- n = i++;
- cout <<"3. You enjoy having a wide circle of acquaintances. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = e++;
- else
- if (awnser == 'N'|| 'n')
- n = i++;
- cout <<"4. You feel involved when watching soaps. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = f++;
- else
- if (awnser == 'N'|| 'n')
- n = t++;
- cout <<"5. You are usually the first to react to an unexpected event:\n";
- cout <<" the telephone ringing or unexpected question. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = e++;
- else
- if (awnser == 'N'|| 'n')
- n = i++;
- cout <<"6. You are more interested in a general idea than in the details\n";
- cout <<" of its realization. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = in++;
- else
- if (awnser == 'N'|| 'n')
- n = s++;
- cout <<"7. You tend to be unbiased even if this might endanger your good\n";
- cout <<" relations with people. Y/N ";
- cin.getline(response,256);
- awnser = atoi(response);
- if (awnser == 'y' || 'Y')
- y = t++;
- else
- if (awnser == 'N'|| 'n')
- n = f++;