Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project 3 part 2 Book v0.5
//gcc 5.4.0 #include <stdio.h> // //Start Program: //int x; //int Satslots=5; //int Sunslots=5; //PRINT "Welcome to Sunshine Bus Tours \n To Book a tour reservation or Report the avaliable tour slots follow the instructions in the menu below.\n Select Options by typing in the number adjacent to your preferred selection \n \n SELECT DAY:\n\n1.Book for Saturday\n 2. Book for Sunday\n3.Report Avaliable Slots\n 4.Quit Program\n" //do{ //READ x // switch(x){ // case 1: // if(Satslot<=0) // PRINT "There are no slots avaliable on Saturday."; // else // --Satslots; // PRINT "You have registered for a tour on Saturday. There are %d slots remaining.",Satslots // case 2: // if(Sunslot<=0) // PRINT "There are no slots avaliable on Sunday."; // else // --Sunslots; // PRINT "You have registered for a tour on Sunday. There are %d slots remaining.",Sunslots // case 3: // PRINT "There are %d slots open on Saturday",Satslots // PRINT "There are %d slots open on Sunday",Sunslots // case 4: // PRINT "Thanks for stopping by" // return 0; // } // }while(x!=4) //End Program: int main(void){ int x; int Satslots=5; int Sunslots=5; printf("Welcome to Sunshine Bus Tours \n To Book a tour reservation or Report the avaliable tour slots follow the instructions in the menu below.\n Select Options by typing in the number adjacent to your preferred selection \n \n SELECT DAY:\n\nBook for a tour on:\n 1.Saturday\n 2.Sunday\n\n3.Report Avaliable Slots\n 4.Quit Program\n"); do{ scanf("%d",&x); switch(x){ case 1: if(Satslot<=0) printf("There are no slots avaliable on Saturday."); else --Satslots; printf("You have registered for a tour on Saturday. There are %d slots remaining.",Satslots); case 2: if(Sunslot<=0) printf("There are no slots avaliable on Sunday."); else --Sunslots; printf("You have registered for a tour on Sunday. There are %d slots remaining.",Sunslots); case 3: printf("There are %d slots open on Saturday",Satslots); printf("There are %d slots open on Sunday",Sunslots); case 4: printf("Thanks for stopping by"); break; } }while(x!=4) return 0; }
run
|
edit
|
history
|
help
0
Check EOF Value
18BCE2182 ASSESS_2 Q2
data types and printf
C_141113_euclides
modify char by mem addr
Matrices de cadenas con *punteros
B_141107_TablaMultiplicar
Bit
Double data type.c
Loop-worksharing