Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 2.62 KB | None | 0 0
  1. Domains
  2. A,B,C,D,E,F,G,H=integer.
  3.  
  4. predicates
  5. start.
  6. sum.
  7.  
  8. score(A,B,C,D,E,F,G,H).
  9.  
  10.  
  11.  
  12. clauses
  13. score(A,B,C,D,E,F,G,H):-
  14. S = A+B+C+D+E+F+G+H,
  15. write("Your depression level is ",S).
  16.  
  17.  
  18.  
  19. start:-sum,nl.
  20. sum:-
  21. makewindow(1,2,3,"Depressiion test",0,0,25,80),
  22.  
  23.  
  24.  
  25.  
  26. write("Question 1-How often have you had little interest or pleasure in doing things?"),nl,
  27. write("Not at all- Type 0"),nl,
  28. write("Several days- Type 1"),nl,
  29. write("More than half the days- Type 2"),nl,
  30. write("Nearly Every Day- Type 3"),nl,
  31. readint(A),
  32.  
  33. write("Question 2- How often have you been bothered by feeling down, depressed or hopeless?"),nl,
  34. write("Not at all- Type 0"),nl,
  35. write("Several days- Type 1"),nl,
  36. write("More than half the days- Type 2"),nl,
  37. write("Nearly Every Day- Type 3"),nl,
  38. readint(B),
  39.  
  40. write("Question 3-How often have you been bothered by trouble falling or staying asleep, or sleeping too much?"),nl,
  41. write("Not at all- Type 0"),nl,
  42. write("Several days- Type 1"),nl,
  43. write("More than half the days- Type 2"),nl,
  44. write("Nearly Every Day- Type 3"),nl,
  45.  
  46. readint(C),
  47.  
  48. write("Question 4-How often have you been bothered by feeling tired or having little energy?"),nl,
  49. write("Not at all- Type 0"),nl,
  50. write("Several days- Type 1"),nl,
  51. write("More than half the days- Type 2"),nl,
  52. write("Nearly Every Day- Type 3"),nl,
  53. readint(D),
  54.  
  55. write("Question 5-How often have you been bothered by poor appetite or overeating?"),nl,
  56. write("Not at all- Type 0"),nl,
  57. write("Several days- Type 1"),nl,
  58. write("More than half the days- Type 2"),nl,
  59. write("Nearly Every Day- Type 3"),nl,
  60. readint(E),
  61. write("Question 6-How often have you been bothered by feeling bad about yourself, or that you are a failure, or have let yourself or your family down?"),nl,
  62. readint(F),
  63. write("Not at all- Type 0"),nl,
  64. write("Several days- Type 1"),nl,
  65. write("More than half the days- Type 2"),nl,
  66. write("Nearly Every Day- Type 3"),nl,
  67.  
  68. write("Question 7- How often have you been bothered by trouble concentrating on things, such as reading the newspaper or watching television?"),nl,
  69.  
  70. write("Not at all- Type 0"),nl,
  71. write("Several days- Type 1"),nl,
  72. write("More than half the days- Type 2"),nl,
  73. write("Nearly Every Day- Type 3"),nl,
  74. readint(G),
  75. write("8-How often have you been bothered by moving or speaking so slowly that other people could have noticed, or the opposite - being so fidgety or restless that you have been moving around a lot more than usual?"),nl,
  76. write("Not at all- Type 0"),nl,
  77. write("Several days- Type 1"),nl,
  78. write("More than half the days- Type 2"),nl,
  79. write("Nearly Every Day- Type 3"),nl,
  80. readint(H),
  81. score(A,B,C,D,E,F,G,H).
  82. goal
  83. start.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement