//Declare Funtions
void Type();
void Home();
void RentDetails();
void RentDisplay();
//Declare Variable
int NumberRent = 0;
char NameRent[10];
char TypeCarRent[10];
char DateRent[10];
int main(int argc, char** argv)
{
printf("******Welcome To Project Rent Car******\n");
Home();
return 0;
}
//Functions Definitions
void Home()
{
printf("\n");
printf("-----------------------------HOME-------------------------------\n\n");
printf("ENTER Number Of Cars On RENT ( 1 to 20 ) ");
scanf("%d" , &NumberRent);
Type();
}
void Type()
{
int type = 0;
printf("----------------------------------------------------------------\n");
printf("please select One Option \n 1. Home \n 2. Enter Rent Detailes \n 3. Display Rent Details");
printf("\n****Or Enter Any Key To Close***");
scanf("%d" , &type);
switch(type)
{
case 1 :
Home();
break;
case 2 :
RentDetails();
break;
case 3 :
RentDisplay();
break;
}
}
void RentDetails()
{
int lowerlimit=0 , count=1;
printf("\n");
printf("-------------------------- Rent Details ---------------------------\n\n");
for(count=1 ; count <= NumberRent ; count++)
{
printf("Details for Customer Number %d ", count);
if(lowerlimit < NumberRent)
{
printf("\n please Enter Name Of Customer :");
scanf("%s" , &NameRent[lowerlimit]);
printf("please Enter Type Car Details :");
scanf("%s" , &TypeCarRent[lowerlimit]);
printf("please Enter Date of Rent :");
scanf("%s" , &DateRent[lowerlimit]);
printf("\n\n");
printf("------------------------------Done-------------------------------\n\n");
lowerlimit++;
}
else
{
printf("Can't Save More");
}
}
Type();
}
void RentDisplay()
{
int N=1;
printf("\n");
printf("--------------------------Display Rents--------------------------\n\n");
for(N = 1 ; N <= NumberRent ; ++N)
{
printf(" number : %d \n", N);
printf(" Name : %s \n" , &NameRent[N]);
printf(" Type Car : %s \n", &TypeCarRent[N]);
printf(" Date Rent : %s \n" , &DateRent[N]);
printf("---------------------------------\n");
}
printf("\n\n");
Type();
}
0 comments:
Post a Comment