Needing to make a application in Visual C++ that can will be used on a bus ticketing programme. I get no errors in my code but when I run it and enter the first number it errors can any one help;
Code:
/*************************************************/
/**** Bus Ticketing System ****/
/************************************************/
#include <stdio.h>
#include <conio.h>
#include <time.h>
void cash(void);//function prototype
void card(void);//function prototype
void time(void);//function prototype
void welcome(void);//function prototype
main()
{
int passengers =0;
int stops;
int testnum = 0;
for(stops = 1; stops < 13 ; stops++) {
do{
welcome();
time();
printf("This is stop number %d\n\n", stops);
printf("Enter number of passengers for this one ticket\n\n");
scanf("%d", passengers);
printf("The cost of the ticket will be %d", passengers * 75);
switch(testnum) {
case 0 : continue;//function call
break;
case 1 : cash();//function call
break;
case 2 : card();//function call
break;
default : printf("The number entered was %d\n", testnum);
break;
}
}while(testnum !=0);
return 0;
}
}
/*** Start Of Function Defintions***/
void cash(void)//function defintions
{
printf("There are %d passengers on this ticket, passengers * 75");
}
void card(void)//function definitions
{
printf("Welcome aboard card holder!");
}
void time(void)//function definitions
{
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n\n", timeStr);
}
void welcome(void)//function definion
{
puts("\t\t\tName Edited Out\n\t\t\tBus Ticketing System\n");
}