Travel minang maimbau is an application with C Programming. This application tell about buying tickets. In this program have 5 menu. There are : 1. Route Lintau – Padang and Padang – Lintau 2. Route Lintau – Pekanbaru and Pekanbaru – Lintau 3. Route Lintau – Dumai and Dumai – Lintau 4. Help 5. Exit In menu 1,2,3 , we must input how many adult passenger and child passenger. And program will process and calculate it. And finally, program will display how much many will you paid. In menu 4 include about tariff of this travel. user can see tariff for each of route. And in this program has three functions. There are : 1. PayPadang Function

void PayPadang(float adult, float child){
pay = (adult*35000) + (child*25000);
printf("\n                                            You must pay :Rp %.2f \n\n", pay);
printf("\n                                 Thank you ^_^ \n\n");
printf("                          Copyright @2013 Programmer Muslim                \n");
printf("___________________________________________________________________________\n");
return;
}

2. PayPekanbaru

void PayPekanbaru(float adult, float child){
pay = (adult*110000) + (child*55000);
printf("\n                                            You must pay :Rp %.2f \n\n", pay);
printf("\n                                 Thank you ^_^ \n\n");
printf("                          Copyright @2013 Programmer Muslim                \n");
printf("___________________________________________________________________________\n");
return;
}

3. PayDumai

void PayDumai(float adult, float child){
pay = (adult*135000) + (child*65000);
printf("\n                                            You must pay :Rp %.2f \n\n", pay);
printf("\n                                 Thank you ^_^ \n\n");
printf("                          Copyright @2013 Programmer Muslim                \n");
printf("___________________________________________________________________________\n");
return;
}

and then flowchart for this program :

flowadada

Source code program :


#include
#include
#include
void PayPadang(float adult, float child);
void PayPekanbaru(float adult, float child);
void PayDumai(float adult, float child);
float pay;
int main(void){
int ad1, cl1;
int choice;

index:
printf("**********************************************************************\n");
printf("* Welcome to Travel Minang Maimbau Application *\n");
printf("**********************************************************************\n\n");
printf(" Product by : Rizki Syaputra _49013097 \n");
printf("______________________________________________________________________\n\n");
printf("Please Enter 1-5 for access this application \n");
printf("1.Rute Lintau - Padang and Padang - Lintau \n");
printf("2.Rute Lintau - Pekanbaru and Pekanbaru - Lintau \n");
printf("3.Rute Lintau - Dumai and Dumai - Lintau \n");
printf("4.Help \n");
printf("5.Exit \n");
printf("______________________________________________________________________\n");
printf("Please input number 1-5 :");
scanf_s("%d",&choice);

switch(choice){
case 1 :
printf("\n\n==================================================================\n");
printf("Travel Minang Maimbau Rute Lintau - Padang and Padang - Lintau \n\n");
printf("Please answers below question : \n\n");
printf("How many adult passenger ? ");
scanf_s("%d",&ad1);
printf("How many child passenger ? ");
scanf_s("%d",&cl1);
printf("\n____________________________________________________________________\n");
PayPadang(ad1,cl1);
system("pause");
break;
case 2 :
printf("\n\n==================================================================\n");
printf("Travel Minang Maimbau Rute Lintau - Pekanbaru and Pekanabru- Lintau \n\n");
printf("Please answers below question : \n\n");
printf("How many adult passenger ? ");
scanf_s("%d",&ad1);
printf("How many child passenger ? ");
scanf_s("%d",&cl1);
printf("\n____________________________________________________________________\n");
PayPekanbaru(ad1,cl1);
system("pause");
break;
case 3:
printf("\n\n==================================================================\n");
printf("Travel Minang Maimbau Rute Lintau - Pekanbaru and Pekanabru- Lintau \n\n");
printf("Please answers below question : \n\n");
printf("How many adult passenger ? ");
scanf_s("%d",&ad1);
printf("How many child passenger ? ");
scanf_s("%d",&cl1);
printf("\n____________________________________________________________________\n");
PayDumai(ad1,cl1);
system("pause");
break;
case 4 :
printf("\n\n==========================================================================================\n");
printf("Help\n");
printf("For use this application please press number 1 until number 5\n");
printf("1.Rute Lintau - Padang and Padang - Lintau \n");
printf("2.Rute Lintau - Pekanbaru and Pekanbaru - Lintau \n");
printf("3.Rute Lintau - Dumai and Dumai - Lintau \n");
printf("4.Help \n");
printf("5.Exit \n");
printf("Those are list of Price our travel : \n");
printf("1. Lintau Padang and padang - Lintau Rp 35000 for an adult and Rp 25000 for a child\n");
printf("2. Lintau Pekanbaru and Pekanbaru - Lintau Rp 110000 for an adult and Rp 55000 for a child\n");
printf("3. Lintau Dumai and Dumai - Lintau Rp 135000 for an adult and Rp 65000 for a child\n");
printf("\n\nThank you \n");
system("pause");
break;
case 5 :
exit;
break;
default:
goto index;
printf("Please press number 1 - 5 !\n");
break;
}
}

void PayPadang(float adult, float child){
pay = (adult*35000) + (child*25000);
printf("\n You must pay :Rp %.2f \n\n", pay);
printf("\n Thank you ^_^ \n\n");
printf(" Copyright @2013 Programmer Muslim \n");
printf("___________________________________________________________________________\n");
return;
}

void PayPekanbaru(float adult, float child){
pay = (adult*110000) + (child*55000);
printf("\n You must pay :Rp %.2f \n\n", pay);
printf("\n Thank you ^_^ \n\n");
printf(" Copyright @2013 Programmer Muslim \n");
printf("___________________________________________________________________________\n");
return;
}
void PayDumai(float adult, float child){
pay = (adult*135000) + (child*65000);
printf("\n You must pay :Rp %.2f \n\n", pay);
printf("\n Thank you ^_^ \n\n");
printf(" Copyright @2013 Programmer Muslim \n");
printf("___________________________________________________________________________\n");
return;
}

Output Program : 1

Picture 1. Main Application

2

Picture 2. When press 5

3

Picture 3. Menu 1

4

Picture 4. Menu 2

5

Picture 5. Menu 3

6

Picture 6. Menu 4

Link Video :

https://www.youtube.com/watch?v=mYbXzkGnAKg&feature=youtu.be

Advertisements