Friday, June 11, 2021

C Program to extract the kingdom of an organism

 #include <conio.h>

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

int main()

{

char organism[25],ans[10], result[10]="Y";

  printf("This is a program to know the kingdom of an organism. (Press Enter)");

getch();

printf("\nBut I need some hints from you while classifying them.(Press Enter)");

getch();

printf("\nI will ask you some Yes/No questions and you need to write \"Y\" for Yes and \"N\"for No.(Press Enter)");

getch();

printf("\nPress Space if you are okay with it.");

getch(); 

printf("\nEnter the name of an organism ");

scanf("%s",organism);

//Round 1

printf("Is %s Prokaryote?",organism);

scanf("%s",ans);

    if(strcmp(strupr(ans),result)==0)

{

printf("\nOur AI is pondering over the informations you supplied (Press Enter) ");

getch();

printf(" \n*********************************************************\n* Name:\t\t%s\n*Kingdom:\tMonera\n* Character:\tNon memberane bound cell organelles\n*********************************************************\n\n",organism);

}

else 

{//Round 2

printf("\nIs %s Unicellular?",organism);

scanf("%s",ans);

      if(strcmp(strupr(ans),result)==0)

{

printf("\nOur AI is pondering over the informations you supplied (Press Enter) ");

getch();

printf(" \n*********************************************************\n* Name:\t\t%s\n* Kingdom:\tProtista\n* Character:\tMicroscopic & membrane bound cell organelles\n*********************************************************\n\n",organism);

}

else

{//Round 3 

printf("\nIs %s Autotroph?",organism);

scanf("%s",ans);

    if(strcmp(strupr(ans),result)==0)

{

printf("\nOur AI is pondering over the informations you supplied (Press Enter) ");

getch();

printf(" \n*********************************************************\n* Name:\t\t%s\n* Kingdom:\tPlantae\n* Character:\tUsually Non motile and Photosynthetic\n*********************************************************\n\n",organism);

}

else 

{//Round 4

printf("\nIs %s Decomposer?",organism);

scanf("%s",ans);

    if(strcmp(strupr(ans),result)==0)

{

printf("\nOur AI is pondering over the informations you supplied (Press Enter) ");

getch();

printf(" \n*********************************************************\n* Name:\t\t%s\n* Kingdom:\tFungi\n* Character:\tConsumes dead organic matter\n*********************************************************\n\n",organism);

}

else 

{//Round 5

printf("\nIs %s consumer?",organism);

scanf("%s",ans);

    if(strcmp(strupr(ans),result)==0)

{

printf("\nOur AI is pondering over the informations you supplied (Press Enter) ");

getch();

printf(" \n*********************************************************\n* Name:\t\t%s\n* Kingdom:\tAnimalia\n* Character:\tMotile and most developed organism \n*********************************************************\n\n",organism);

}

else 

{printf("\nSorry!! The organism can't be classified as per the present rules and regulations of classification.\n\n\n\n\n\n\n\nReport Bug (Click here)");

}

}

}

}

}

printf("\nPress Enter to Close Program\n");

getch();

return 0;

}

No comments:

Post a Comment

Meet links

 Section 11A meet.google.com/edcdmynkjh Section 11 B meet.google.com/tapmhdtkfj Section 11C meet.google.com/sxajjevufp Section !!D meet.goog...