Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dos.h>
- #include <io.h>
- #include <stdio.h>
- #include <string.h>
- void beep()
- {
- // sound (200);
- // delay(25);
- // nosound();
- return;
- }
- void main ()
- {
- char trn[9], f_name[15], l_name[15], phonenum[7], repair_code, deposit_decision;
- float balance, cost, gct, total, deposit_amt;
- int serv_time=0,SHOE_NUMBER,pickup;
- const EXPRESS_RATE = 1.5 ;
- const GCT_RATE = 0.165; // 16.5%
- const HEEL_RATE = 500;
- const STITCH_RATE = 700;
- const PATCH_RATE = 300;
- const STD_HEEL_TECH_RATE = 1000;
- const STD_STITCH_TECH_RATE = 1300;
- const STD_PATCH_TECH_RATE = 1000;
- while (1) {
- printf ("\n\r Please Enter your First Name: ");
- scanf ("%s", &f_name);
- // beep();
- printf ("\n\r Please enter your Last Name: ");
- scanf ("%s", &l_name);
- printf ("\n\r Please Enter your TRN Number: ");
- scanf ("%s", &trn);
- if (strcmp ("XXX",strupr(trn)) == 0) return;
- printf (" \n\r Please Enter your Contact Number: ");
- scanf ("%s", &phonenum);
- do {
- printf ("\n\r Please enter the amount of shoes to be repaired: ");
- scanf ("%d", &SHOE_NUMBER);
- if ((SHOE_NUMBER != 1) && (SHOE_NUMBER != 2)) {
- printf("We only accept 1 or 2.\n \n");
- }
- } while ((SHOE_NUMBER != 1) && (SHOE_NUMBER != 2));
- //Available times are 30,60,180, minutes.
- do {
- printf ("\n\r Please Select the type of repair you are requesting to be done... \n");
- printf (" (H) For Heel Tip Replacement \n");'H';
- printf (" (S) For Stretching \n"); 'S';
- printf (" (P) For Patching \n"); 'P';
- scanf ( " %c", &repair_code);
- repair_code = toupper(repair_code);
- if ((repair_code != 'H') && (repair_code != 'S') && (repair_code!= 'P')) {
- printf("Please enter H,S or P \n ");
- }
- } while ((repair_code != 'H') && (repair_code != 'S') && (repair_code!= 'P'));
- printf ("\n\r What is the estimated time you would like the shoe to be repaired? ");
- scanf ("%d", &serv_time);
- if (serv_time > 30 && repair_code == 'H' ) {
- cost =(SHOE_NUMBER * HEEL_RATE) + (STD_HEEL_TECH_RATE * SHOE_NUMBER);
- printf(" test1");
- }
- else if (serv_time == 30 && repair_code == 'H')
- {
- cost =(SHOE_NUMBER * HEEL_RATE) + (STD_HEEL_TECH_RATE * SHOE_NUMBER) + (STD_HEEL_TECH_RATE * EXPRESS_RATE) ;
- printf(" test2");
- }
- else if (serv_time > 30 && repair_code == 'S')
- {
- cost = (SHOE_NUMBER * STITCH_RATE);
- printf(" test3");
- }
- else if (serv_time == 30 && repair_code == 'S')
- {
- cost = (SHOE_NUMBER * STITCH_RATE) + (STD_STITCH_TECH_RATE * SHOE_NUMBER) + (STD_STITCH_TECH_RATE * EXPRESS_RATE) ;
- printf(" test4");
- }
- else if (serv_time > 30 && repair_code == 'P')
- {
- cost = (SHOE_NUMBER * PATCH_RATE);
- printf(" test5");
- }
- else if (serv_time == 30 && repair_code =='P' )
- {
- cost = (SHOE_NUMBER * PATCH_RATE) + (STD_PATCH_TECH_RATE * SHOE_NUMBER) + (STD_PATCH_TECH_RATE * EXPRESS_RATE);
- printf(" test6");
- }
- printf ("\n\r Would you like to make a deposit?");
- scanf(" %c",&deposit_decision);
- if (deposit_decision == 'Y');
- {
- printf ("\n\r How much would you like to deposit?");
- scanf (" %d", &deposit_amt);
- }
- //Calcuations
- gct = (GCT_RATE*cost);
- balance = deposit_amt - cost;
- total = (cost+gct) - balance;
- printf( "\n\n\n\r\t\t Service Log \n");
- printf ("Customer Name: %s %s \n", f_name,l_name);
- printf ("TRN Number: %s . \n"),trn;
- printf ("Repair Code: %c. \n",repair_code);
- printf ("The number of shoes submitted: %i.\n"),SHOE_NUMBER ;
- printf ("The total service cost is: %i\n"),cost;
- printf ("The GCT is: %i \n"),gct;
- printf ("The amount deposited was: %i \n"),deposit_amt;
- printf ("The balance is: %i \n" ),balance;
- printf ("The total cost is: %i \n" ),total;
- printf ("\nThank you for making it Shoe Spec , We hope you enjoyed our services. \n");
- /*printf (" \n \n");
- printf (" * * * * * * * *\n");
- printf (" * * * * \n ");
- printf (" * ** *\n");
- printf (" * Done By * \n");
- printf (" * Jhevante Mcdonald * \n");
- printf (" * 1500155 * \n");
- printf (" * * \n");
- printf (" * University * \n");
- printf (" * Of *\n");
- printf (" * Technology, * \n");
- printf (" * Jamaica * \n");
- printf (" * * \n");
- printf (" * Y2Sem1 * \n");
- printf (" * * \n");
- printf (" * * \n");
- printf (" ***** \n");
- getch();
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement