mlm@cmu-cs-cad.ARPA (Michael Mauldin) (02/07/85)
Hackers! Test your stress level quickly and painlessly. use "cc -o stress stress.c" to compile this program. Michael L. Mauldin (Fuzzy) Department of Computer Science Mauldin@CMU-CS-CAD.ARPA Carnegie-Mellon University (412) 578-3065 Pittsburgh, PA 15213 -------- cut here ---------------- cut here ---------------- cut here ------- #!/bin/sh echo 'Start of Stress Test Distribution:' echo 'x - stress.c' sed 's/^X//' > stress.c << '/' X/* X * stress.c: Stress questionaire from Time, June 6, 1983. X */ X X# include <stdio.h> X Xchar *quest[] = { X "You eat at least one hot, balanced meal a day", X "You get seven to eight hours of sleep at least four nights a week", X "You give and receive affection regularly", X "You have at least one relative within 50 miles on whom you can rely", X "You exercise to the point of perspiration at least twice a week", X "You smoke less than half a pack of cigarettes a day", X "You take fewer than five alcoholic drinks a week", X "You are the appropriate weight for your height", X "You have an income adequate to meet basic expenses", X "You get strength from your religious beliefs", X "You regularly attend club or social activities", X "You have a network of friends and acquaintances", X "You have one or more friends to confide in about personal matters", X "You are in good health (including eyesight, hearing, teeth)", X "You are able to speak openly about your feelings when angry or worried", X "You have regular conversations with the people you live with\n about domestic problems (e.g. chores, money and daily living issues)", X "You do something for fun at least once a week", X "You are able to organize your time effectively", X "You drink fewer than three cups of coffee (or tea or cola) a day", X "You take quiet time for yourself during the day", X NULL X}; X Xmain () X{ int score = 0, answer; X char **q = quest; X X X printf ("******************************************************\n"); X printf ("* Stress test from TIME Magazine, June 6, 1983. *\n"); X printf ("* Answer each question with a number from 1 to 5. *\n"); X printf ("* 1 = almost always, 5 = never. *\n"); X printf ("******************************************************\n\n"); X while (*q) X { printf ("%s: ", *q++); X scanf ("%d", &answer); X while (answer < 1 || answer > 5) X { printf ("Please enter a number from 1 (always) to 5 (never): "); X scanf ("%d", &answer); X } X score += answer; X } X score -= 20; X X printf ("\nYour stress quotient is %d (range is 0 to 80).\n", score); X if (score <= 0) printf X ("People who cheat on stress tests are highly susceptible to stress.\n"); X else if (score <= 10) printf X ("You are probably from California.\n"); X else if (score <= 30) printf X ("You are reasonably well adjusted.\n"); X else if (score <= 50) printf X ("You are vulnerable to stress.\n"); X else if (score <= 75) printf X ("You are seriously vulnerable to stress.\n"); X else if (score <= 78) printf X ("You are extremely vulnerable to stress.\n"); X else if (score >= 79) printf X ("You should buy lots of life insurance soon.\n"); X} / echo 'Stress Test Distribution complete.' exit