This program gives us choose 3 ways of arranging the books by title, author, and EDITORIAL. We
a little complicated, because we did not know how complicated
was, but when analyzing the problem, we conclude the following.
was, but when analyzing the problem, we conclude the following.
the pseudocode.
In the pseudocode, we managed switch, with if, to give the user the choice of how to accommodate their books in the lbrero. and move and accommodate the other, until it ends.
# include
# include
int option;
int main ()
{printf ("About the books they want to accommodate the bookseller \\ n ");
do {printf (" \\ nYou books on the shelf? \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & , option);
} while (opcion! = 1 & & Option! = 2) do {
do {printf ("\\ nWhat you order, pick and choose? \\ N1.-title \\ n2.-Author \\ n3.-Editorial \\ n ");
scanf ("% d ", & option);
} while (choice \u0026lt;1
option> 3);
clrscr ();
do {
switch (option) {
Case 1:
{printf ("\\ nFor TITLE \\ n");
getch ();
printf ("Take a book \\ n" )
getch ();
printf ("Initial Search title \\ n");
getch ();
printf ("At the bookstore where you are looking for that initial \\ n") ;
getch ();
printf ("If there are many books there, looking every point \\ nof title of the book to find a place \\ n");
getch ();
option = 0 ;
break;}
case 2: {
printf ("\\ nFor AUTHOR \\ n");
getch ();
printf ("Take a book search the author's name \\ n ");
getch ();
printf (" In the bookstore looking for the place where you the author ");
getch ();
printf (" \\ n \\ nIf there are many books there, find some number or name of the title \\ n ");
getch ();
printf (" Get the right place according to the initial number or title, in alphabetical order \\ n ");
getch ();
option = 0;
break;}
case 3: {
printf (" \\ nFor EDITORIAL \\ n ");
getch ();
printf ("\\ symptoms a book, find the name inicial publisher \\ n");
getch ();
printf ("\\ nIn the bookstore looking for the place where this editorial will \\ n ");
getch ();
printf (" \\ nA one or more books \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & option);
if (option == 2) {
option = 0;
break;}
else {printf (" Arrange them by author ");
getch ();
option = 2;
break;}
}} while (option == 2);
printf ("\\ nColocala there \\ n");
getch ();
clrscr ();
printf ("\\ nYou more books to accommodate \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & , option);
} while (option == 1);
printf ("\\ nClick Done \\ n");}
PROGRAM EXECUTED IN PICTURES, first
example
The program begins by telling the user to close the books at the bookstore, he asks if you have books on the shelf and the user says no, the next question is the one with the switch,
that with which we are displaying the 3 different options gives the user choice.
then remind the user the order said they have their books, gives instructions, asks that if you have more books to accommodate, and in this case the end user and to accommodate the books, the other option we will see in following example.
USER-MACHINE INTERACTION, IS GIVEN OR PRESS ENTER Letters, then an instruction, and after it appears the TEXT, AND CHOOSING A NUEMRO depending on which options are given.
SECOND EXAMPLE:
In this case, the user tells us that no books on the shelf.
The user chooses to order the books by author, which was what we had asked Dr. but we did a little different.
The program reminds the user the option you chose.
Gives instructions
He asks that if you have more books to accommodate, in this case, the user
says if that still does not end.
The question that continues is the same as the beginning, we used the 3 cases, but if the user does not remember as you are ordering your bookstore, terrible mistake will occur, when looking for a book.
Le repeats the instructions, asks again if you have more books to accommodate the user says no.
and there ends the user to accommodate his books, and the program give instructions.
NOTE: The program does not end until the user tells you books no longer accommodate.
GERMAN GARCIA GABRIELA 1410319
VILLARREAL JUAN MANUEL CASANOVA 1453829