Advertisement
snaptrap013

fixed

May 15th, 2021
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5.     char name[50], email[50], symptomA, symptomB;
  6.     char area, country, contact;
  7.     float scores, scoreA, scoreB, scoreC, scoreD, scoreE;
  8.     float status;
  9.     printf ("Enter your name\t:");
  10.     gets(name);
  11.     printf ("Enter your email:");
  12.     gets(email);
  13.  
  14.  
  15.  
  16.     printf ("\n a) Fever");
  17.     printf ("\n b) Chills ");
  18.     printf ("\n c) Shivering");
  19.     printf ("\n d) Body ache");
  20.     printf ("\n e) Headache");
  21.     printf ("\n f) Sore throat ");
  22.     printf ("\n g) Nausea or vomiting ");
  23.     printf ("\n h) Fatigue ");
  24.     printf ("\n i) Runny nose or nasal congestion");
  25.     printf ("\n\nAre you exhibiting 2 or more symptoms as listed above?");
  26.     printf ("\n\tY:Yes | N:No :");
  27.     symptomA = getchar();
  28.     getchar();
  29.  
  30.  
  31.     printf ("\n a) Loss of smell");
  32.     printf ("\n b) Loss of taste ");
  33.     printf ("\n c) Cough ");
  34.     printf ("\n d) Difficulty breathing");
  35.     printf ("\n\nBesides the above, are you exhibiting any of the symptoms listed below?");
  36.     printf ("\n\tY:Yes | N:No :");
  37.     symptomB = getchar();
  38.     getchar();
  39.  
  40.     printf ("\n\nHave you attended any event / areas associated with known COVID-19 cluster?");
  41.     printf ("\n\tY:Yes | N:No :");
  42.     area = getchar();
  43.     getchar();
  44.  
  45.     printf ("\n\nHave you travelled to any country outside Malaysia within 14 days before onset of symptoms?");
  46.     printf ("\n\tY:Yes | N:No :");
  47.     country = getchar();
  48.     getchar();
  49.    
  50.     printf ("\n\nHave you had close contact to confirmed or suspected case of COVID-19 within 14 days before onset of illness?");
  51.     printf ("\n\tY:Yes | N:No :");
  52.     contact = getchar();
  53.  
  54.     if (symptomA=='N'||symptomA=='n')
  55.         scoreA+=1;
  56.     else
  57.         scoreA+=0;
  58.     if (symptomB=='N'||symptomB=='n')
  59.         scoreB+=1;
  60.     else
  61.         scoreB+=0;
  62.     if (area=='N'||area=='n')
  63.         scoreC+=1;
  64.     else
  65.         scoreC+=0;
  66.     if (country=='N'||country=='n')
  67.         scoreD+=1;
  68.     else
  69.         scoreD+=0;
  70.     if (contact=='N'||contact=='n')
  71.         scoreE+=1;
  72.     else
  73.         scoreE+=0;
  74.  
  75.     scores=scoreA+scoreB+scoreC+scoreD+scoreE;
  76.     status=(scores/5)*100;
  77.  
  78.     printf ("\nName\t:%s",name);
  79.     printf ("\nEmail\t:%s",email);
  80.     printf ("\nPercent Health:%.2f",status);
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement