AD (728x90)

Blogroll

Sabtu, 19 Oktober 2013

Travel Minang Maimbau Application with C Programming

Share it Please
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

[sourcecode language="c"]
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;
}
[/sourcecode]

2. PayPekanbaru

[sourcecode language="c"]
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;
}
[/sourcecode]

3. PayDumai

[sourcecode language="c"]
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;
}
[/sourcecode]

and then flowchart for this program :

flowadada

Source code program :

[sourcecode language="c"]

#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;
}

[/sourcecode]

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



[youtube http://www.youtube.com/watch?v=mYbXzkGnAKg&w=500&h=300]

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 komentar:

Posting Komentar

© 2013 Programmer Muslim. All rights resevered. Designed by Templateism