fork download
  1. #include <stdio.h>
  2. #include <conio.h>
  3. int main()
  4. {
  5. printf("_________________________________________________________________________________\n");
  6. printf("|________________________________TYPES OR BOOK___________________________________|\n");
  7. printf("|1. Complete Ghost Stories---------[E]--------|Price------------329 B.|\n\n");
  8. printf("|2. GHOST STORIES------------------[G]--------|Price------------296 B.|\n\n");
  9. printf("|3. Get Out------------------------[T]--------|Price------------600 B.|\n\n");
  10. printf("|4. The Babadook-------------------[C]--------|Price------------615 B.|\n\n");
  11. printf("|5. When I fell from the sky-------[S]--------|Price------------465 B.|\n\n");
  12. printf("|6. Shakespeare--------------------[U]--------|Price------------190 B.|\n\n");
  13. printf("|7. Charles Dicken-----------------[F]--------|Price------------355 B.|\n\n");
  14. printf("|8. Pulitzer Prize-----------------[K]--------|Price------------560 B.|\n\n");
  15. printf("|9. Harry Potter-------------------[L]--------|Price-----------1300 B.|\n\n");
  16. printf("|10.Jane Austen--------------------[P]--------|Price------------658 B.|\n\n");
  17. printf("|11.Beowulf------------------------[J]--------|Price------------196 B.|\n\n");
  18. printf("|12.The Canterbury Tales-----------[R]--------|Price------------385 B.|\n\n");
  19. printf("|13.Emma---------------------------[M]--------|Price------------120 B.|\n\n");
  20. printf("|14.Mary Barton--------------------[I]--------|Price------------665 B.|\n\n");
  21. printf("|15.Selected Poems-----------------[X]--------|Price------------555 B.|\n\n");
  22.  
  23. printf("|___________________________________________________________|\n");
  24. printf("|____________________Exit with Program [O]__________________|\n");
  25. printf("|___________________________________________________________|\n");
  26.  
  27. //varible
  28. char choose,Book;
  29. int count = 0, sum = 0;
  30. //choose
  31. printf("\n\nWould you like to order some drink? [Y/N] : ");
  32. choose = getch();
  33. printf("%c\n");
  34.  
  35. //choose 'y'
  36. if(choose == 'Y'){
  37. while(Book != 'O' || Book == 'o');{
  38. count += 1;
  39. printf("\n\nPlease select a BOOK item : ");
  40. Book = getch();
  41. if(Book == 'E' || Book == 'e'){
  42. printf("\t\tComplete Ghost Stories 329 B.");
  43. sum += 329;
  44. }else if (Book == 'G' || Book == 'g'){
  45. printf("\t\tGHOST STORIES 296 B.");
  46. sum += 296;
  47. }else if (Book == 'T' || Book == 't'){
  48. printf("\t\tGet Out 600 B.");
  49. sum += 600;
  50. }else if (Book == 'C' || Book == 'c'){
  51. printf("\t\tThe Babadook 615 B.");
  52. sum += 615;
  53. }else if (Book == 'S' || Book == 's'){
  54. printf("\t\tWhen I fell from the sky 465 B.");
  55. sum += 465;
  56. }else if (Book == 'U' || Book == 'u'){
  57. printf("\t\tShakespeare 190 B.");
  58. sum += 190;
  59. }else if (Book == 'F' || Book == 'f'){
  60. printf("\t\tCharles Dickent 355 B.");
  61. sum += 355;
  62. }else if (Book == 'K' || Book == 'k'){
  63. printf("\t\tTPulitzer Prize 560 B.");
  64. sum += 560;
  65. }else if (Book == 'L' || Book == 'l'){
  66. printf("\t\tHarry Potter 1300 B.");
  67. sum += 1300;
  68. }else if (Book == 'P' || Book == 'p'){
  69. printf("\t\tJane Austen 658 B.");
  70. sum += 658;
  71. }else if (Book == 'Q' || Book == 'q'){
  72. printf("\t\tBeowulf 196 B.");
  73. sum += 196;
  74. }else if (Book == 'R' || Book == 'r'){
  75. printf("\t\tThe Canterbury Tales 385 B.");
  76. sum += 385;
  77. }else if (Book == 'M' || Book == 'm'){
  78. printf("\t\tEmma 120 B.");
  79. sum += 120;
  80. }else if (Book == 'I' || Book == 'i'){
  81. printf("\t\tMary Barton 665 B.");
  82. sum += 615;
  83. }else if (Book == 'X' || Book == 'x'){
  84. printf("\t\tSelected Poems 555 B.");
  85. sum += 555;
  86. //exit loop
  87. }else if (Book == 'O' || Book == 'o'){
  88. printf("\t\t----Completed book selection----");
  89. printf("\n\n\t\tYou have all the book items %d item...",count-1);
  90. printf("\n\n\t\tTotal book prices : %d B.", sum);
  91. printf("\n\n\t\tāree greek mythology books");
  92. printf("\n\n\t\t.....Please wait a moment.....");
  93. break;
  94. }else{
  95. printf("\t\tTry again!!!");
  96. }
  97. }
  98.  
  99. //choose No
  100. }else{
  101. printf("\t\t---Thank you....Goodbye---");
  102. }
  103. getch();
  104. return 0;
  105. }
Success #stdin #stdout 0.03s 25720KB
stdin
Standard input is empty
stdout
#include <stdio.h>
#include <conio.h>
int main()
{
	printf("_________________________________________________________________________________\n");
	printf("|________________________________TYPES OR BOOK___________________________________|\n");
	printf("|1.	Complete Ghost Stories---------[E]--------|Price------------329 B.|\n\n");
	printf("|2.	GHOST STORIES------------------[G]--------|Price------------296 B.|\n\n");
	printf("|3.	Get Out------------------------[T]--------|Price------------600 B.|\n\n");
	printf("|4.	The Babadook-------------------[C]--------|Price------------615 B.|\n\n");
	printf("|5.	When I fell from the sky-------[S]--------|Price------------465 B.|\n\n");
	printf("|6.	Shakespeare--------------------[U]--------|Price------------190 B.|\n\n");
	printf("|7.	Charles Dicken-----------------[F]--------|Price------------355 B.|\n\n");
	printf("|8.	Pulitzer Prize-----------------[K]--------|Price------------560 B.|\n\n");
	printf("|9.	Harry Potter-------------------[L]--------|Price-----------1300 B.|\n\n");
	printf("|10.Jane Austen--------------------[P]--------|Price------------658 B.|\n\n");
	printf("|11.Beowulf------------------------[J]--------|Price------------196 B.|\n\n");
	printf("|12.The Canterbury Tales-----------[R]--------|Price------------385 B.|\n\n");
	printf("|13.Emma---------------------------[M]--------|Price------------120 B.|\n\n");
	printf("|14.Mary Barton--------------------[I]--------|Price------------665 B.|\n\n");
	printf("|15.Selected Poems-----------------[X]--------|Price------------555 B.|\n\n");
	
	printf("|___________________________________________________________|\n");
	printf("|____________________Exit with Program [O]__________________|\n");
	printf("|___________________________________________________________|\n");
	
	//varible
	char choose,Book;
	int count = 0, sum = 0;
	//choose
	printf("\n\nWould you like to order some drink? [Y/N] : ");
	choose = getch();
	printf("%c\n");
	
	//choose 'y'
	if(choose == 'Y'){
		while(Book != 'O' || Book == 'o');{
			count += 1;
			printf("\n\nPlease select a BOOK item : ");
			Book = getch();
			if(Book == 'E' || Book == 'e'){
				printf("\t\tComplete Ghost Stories	329 B.");
				sum += 329;
			}else if (Book == 'G' || Book == 'g'){
				printf("\t\tGHOST STORIES	296 B.");
				sum += 296;
			}else if (Book == 'T' || Book == 't'){
				printf("\t\tGet Out	600 B.");
				sum += 600;
			}else if (Book == 'C' || Book == 'c'){
				printf("\t\tThe Babadook	615 B.");
				sum += 615;
			}else if (Book == 'S' || Book == 's'){
				printf("\t\tWhen I fell from the sky	465 B.");
				sum += 465;
			}else if (Book == 'U' || Book == 'u'){
				printf("\t\tShakespeare	190 B.");
				sum += 190;
			}else if (Book == 'F' || Book == 'f'){
				printf("\t\tCharles Dickent	355 B.");
				sum += 355;
			}else if (Book == 'K' || Book == 'k'){
				printf("\t\tTPulitzer Prize	560 B.");
				sum += 560;
			}else if (Book == 'L' || Book == 'l'){
				printf("\t\tHarry Potter	1300 B.");
				sum += 1300;
			}else if (Book == 'P' || Book == 'p'){
				printf("\t\tJane Austen    658 B.");
				sum += 658;
			}else if (Book == 'Q' || Book == 'q'){
				printf("\t\tBeowulf	196 B.");
				sum += 196;
			}else if (Book == 'R' || Book == 'r'){
				printf("\t\tThe Canterbury Tales	385 B.");
				sum += 385;
			}else if (Book == 'M' || Book == 'm'){
				printf("\t\tEmma	120 B.");
				sum += 120;
			}else if (Book == 'I' || Book == 'i'){
				printf("\t\tMary Barton	665 B.");
				sum += 615;
			}else if (Book == 'X' || Book == 'x'){
				printf("\t\tSelected Poems	555 B.");
				sum += 555;
			//exit loop
			}else if (Book == 'O' || Book == 'o'){
				printf("\t\t----Completed book selection----");
				printf("\n\n\t\tYou have all the book items %d item...",count-1);
				printf("\n\n\t\tTotal book prices : %d B.", sum);
				printf("\n\n\t\tāree greek mythology books");
				printf("\n\n\t\t.....Please wait a moment.....");
				break;
		}else{
			printf("\t\tTry again!!!");
		}
	}
	
	//choose No
	}else{
		printf("\t\t---Thank you....Goodbye---");
	}
	getch();
	return 0;
}