DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦ee5385110⟧ TextFile

    Length: 2699 (0xa8b)
    Types: TextFile
    Names: »stress.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Stresstest/stress.c« 

TextFile

/* 
 * stress.c: Stress questionaire from Time, June 6, 1983.
 */

# include <stdio.h>

char *quest[] = {
  "You eat at least one hot, balanced meal a day",
  "You get seven to eight hours of sleep at least four nights a week",
  "You give and receive affection regularly",
  "You have at least one relative within 50 miles on whom you can rely",
  "You exercise to the point of perspiration at least twice a week",
  "You smoke less than half a pack of cigarettes a day",
  "You take fewer than five alcoholic drinks a week",
  "You are the appropriate weight for your height",
  "You have an income adequate to meet basic expenses",
  "You get strength from your religious beliefs",
  "You regularly attend club or social activities",
  "You have a network of friends and acquaintances",
  "You have one or more friends to confide in about personal matters",
  "You are in good health (including eyesight, hearing, teeth)",
  "You are able to speak openly about your feelings when angry or worried",
  "You have regular conversations with the people you live with\n  about domestic problems (e.g. chores, money and daily living issues)",
  "You do something for fun at least once a week",
  "You are able to organize your time effectively",
  "You drink fewer than three cups of coffee (or tea or cola) a day",
  "You take quiet time for yourself during the day",
  NULL
};

main ()
{ int score = 0, answer;
  char **q = quest;


  printf ("******************************************************\n");
  printf ("*   Stress test from TIME Magazine, June 6, 1983.    *\n");
  printf ("*   Answer each question with a number from 1 to 5.  *\n");
  printf ("*   1 = almost always, 5 = never.                    *\n");
  printf ("******************************************************\n\n");
  while (*q)
  { printf ("%s: ", *q++);
    scanf ("%d", &answer);
    while (answer < 1 || answer > 5)
    { printf ("Please enter a number from 1 (always) to 5 (never): ");
      scanf ("%d", &answer);
    }
    score += answer;
  }
  score -= 20;
  
  printf ("\nYour stress quotient is %d (range is 0 to 80).\n", score);
  if      (score <=  0) printf
    ("People who cheat on stress tests are highly susceptible to stress.\n");
  else if (score <= 10) printf
    ("You are probably from California.\n");
  else if (score <= 30) printf
    ("You are reasonably well adjusted.\n");
  else if (score <= 50) printf
    ("You are vulnerable to stress.\n");
  else if (score <= 75) printf
    ("You are seriously vulnerable to stress.\n");
  else if (score <= 78) printf
    ("You are extremely vulnerable to stress.\n");
  else if (score >= 79) printf
    ("You should buy lots of life insurance soon.\n");
}