1. โปรแกรมบอกลักษณะนิสัยจากหมู่เลือด
input รับค่ากลุ๊ปเลือดจากผู้ใช่ A B O หรือ Z (สำหรับ AB)
process เปรียบเทียบอักขระที่รับมากับหมู่เลือดที่กำหนด
output บอกลักษณะนิสัยตามหมู่เลือดที่ได้รับ บอกทั้งแจ้งผลการใส่ข้อมูลที่ผิดพลาด
จาก https://en.wikipedia.org/wiki/Blood_type_personality_theory
Flowchart?
Program
//Idtisak P.
//This programme tells characteristics of user according to their blood types
//
//Users can key either Uppercase or Lowercase
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch;
printf("Please enter your blood type:\n ");
printf("A, B, O, or Z (for AB): ");
scanf("%c",&ch);
switch(ch)
{
case'a':
case'A':
printf("\n %c type person:\n",ch);
printf("********************************************************\n");
printf("Best personalities:\t Earnest, sensible, reserved,\n");
printf("\t\t\t patient, responsible\n");
printf("--------------------------------------------------------\n");
printf("Worst personalities:\t Fastidious, overearnest, stubborn,\n");
printf("\t\t\t tense\n");
break;
case'b':
case'B':
printf("\n %c type person:\n",ch);
printf("*****************************************************\n");
printf("Best personalities:\t Passionate, active, doer,\n");
printf("\t\t\t creative, strong \n");
printf("-----------------------------------------------------\n");
printf("Worst personalities:\t irresponsible, unforgiving, \n");
printf("\t\t\t 'going own way'\n");
break;
case'o':
case'O':
printf("\n %c type person:\n",ch);
printf("*****************************************************\n");
printf("Best personalities:\t Confident, self-determined, optimistic,\n");
printf("\t\t\t strong-willed, intuitive\n");
printf("-----------------------------------------------------\n");
printf("Worst personalities:\t Self-centered, cold, doubtful, \n");
printf("\t\t\t unpredictable, 'workaholic'\n");
break;
case'z':
case'Z':
printf("\n AB type person:\n");
printf("*****************************************************\n");
printf("Best personalities:\t Cool, controlled, rational,\n");
printf("\t\t\t sociable, adaptable\n");
printf("-----------------------------------------------------\n");
printf("Worst personalities:\t Critical, indecisive, forgetful, \n");
printf("\t\t\t irresponsible, 'split personality'\n");
break;
default:
printf("INVALID blood type");
break;
}
printf("\n The information was taken from \n https://en.wikipedia.org/wiki/Blood_type_personality_theory");
return 0;
}