1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
#include <stdio.h> //header
#include <stdlib.h>
int main()
{ //applicant information
char name[30];
char faculty[30];
char matric_no[20];
char date[10];
char vehicle[20];
char destination[50];
char travelling_purpose[50];
int time1, time2, number_passengers;
int mobile_no, total_hours;
printf("Please enter your name : ");
gets(name);
printf("\nPlease enter your faculty name : ");
gets(faculty);
printf("\nPlease enter your matric number : ");
scanf("%s", (char*)&matric_no);
printf("\nDate : ");
scanf("%s", (char*)&date);
printf("\nPlease enter your mobile number : ");
scanf("%d", &mobile_no);
//booking information
//getchar();
fflush(stdin);
printf("\nType of vehicle : ");
scanf("%s", (char*)&vehicle);
printf("\nBooking Date : ");
scanf("%s", (char*)&date);
printf("\nBooking time (24hours) from : ");
fflush(stdin);
scanf("%d",&time1);
printf(" \t\t\tto : ");
fflush(stdin);
scanf("%d",&time2);
//getchar();
printf("\nDestination : ");
fflush(stdin);
gets(destination);
printf("\nTravelling Purpose : ");
gets(travelling_purpose);
printf("\nNumber of passengers : ");
scanf("%d",&number_passengers);
total_hours= time2-time1 ;
//printf("Total hours : %d", total_hours);
printf("\t\t\tSTUDENT VEHICLE BOOKING FORM\n");
printf("================================================================================");
printf("\nAPPLICANT INFORMATION");
printf("\n================================================================================");
printf("\nName : %s", name);
printf("\t\t\t\tMatric Number : %s\n", matric_no);
printf("\nFaculty : %s", faculty);
printf("\t\t\t\tMobile Number : %d\n", mobile_no);
printf("\nDate : %s\n\n", date);
printf("================================================================================");
printf("\nBOOKING INFORMATION");
printf("\n================================================================================");
printf("\n\nType of vehicle : %s", vehicle);
printf("\n\nBooking Date : %s", date);
printf("\n\nBooking Time from>>> %d hour", time1);
printf(" to>>> %d hour", time2);
printf("\n\nTotal booking time : %d hour", total_hours);
printf("\n\nDestination : %s", destination);
printf("\n\nTravelling Purpose : %s", travelling_purpose);
printf("\n\nNumber of passengers : %d", number_passengers);
return 0;
}
|