Report of C Microproject
Report of C Microproject
ON
VEHICLE PARKING
1.0 Brief Description
This website is all about the parking industry. But what is parking and what do people in
the parking industry actually do? This page is all about parking and everything around that
subject. It's created as an ongoing process: This page is never finished and we will keep
adding more and more information to it. Now, let's talk about parking. On Wikipedia the
word ‘parking’ is defined as:
In this case, we’re talking about car parking. You can park your car at a parking space. These
parking spaces can be on several locations: In a parking lot, a parking garage, on the side of the
street, and so on. In every city and on every street there are rules for parking. For example, often
you are allowed to park your car on the side of the street, but sometimes you have to pay for
parking, are only allowed to park for a short period of time or are not allowed to park at all. These
rules are called parking restrictions.
Parking spaces are very important to cities. A city must have enough parking spaces to provide their
residents and their visitors a place to park their car. Since cars are a main factor in transportation, a
city must meet the needs of the drivers. If people can’t find a place to park, or if they have to pay
too much for parking, these people probably won’t come back to your city to do some more
shopping, dining or spending money in any other way. Also residents must have enough place to
park their car nearby their house and workplace.
1. Parking can take considerable street space leading to the lowering of the road capacity.
2. Hence speed will be reduced, journey time & delay will also subsequently increase.
First we discussed in group about to find the subject related to project After discussion
finally, we selected the topic as Vehicle parking. Then we collect information related to
subject. Afterwards, according to the standard format we started to do the work on
project. The three group members decided to do work separately in ways like collecting
information, making proposal and report. Mr. M. Rokade Sir guide us how to
develop/build a program and also with he told how to solve the errors.
According to his guidance we followed the rule and we build the program after solve the
errors. Then we run the program and it run successfully. As per the decision the all
members completed the given work.
From these the c language software program using different function and also with we
studied how to solve the errors.
#define CAR 1
#define SCOOTER 2
v -> type = t ;
v -> row = row ;
v -> col = col ;
if ( t == CAR )
carcount++ ;
else
scootercount++ ;
vehcount++ ;
parkinfo[row][col] = num ;
return v ;
}
vehcount-- ;
}
if ( type == SCOOTER )
{
fromrow += 2 ;
torow += 2 ;
}
if ( r == 2 || r == 4 )
{
arr[0] = -1 ;
arr[1] = -1 ;
}
}
/* get the row-col position for the vehicle with specified number */
void getrcbyinfo ( int type, int num, int *arr )
{
int r, c, fromrow = 0, torow = 2 ;
if ( type == SCOOTER )
{
fromrow += 2 ;
torow += 2 ;
}
void main( )
{
int choice, type, number, row = 0, col = 0 ;
int i, tarr[2] ;
int finish = 1 ;
struct vehicle *v ;
clrscr( ) ;
switch ( choice )
{
case 1 :
clrscr( ) ;
printf ( "\nAdd: \n" ) ;
type = 0 ;
if ( type == CAR )
car[row][col] = add ( type, number, row, col ) ;
else
scooter[row - 2][col] = add ( type, number, row, col ) ; ;
}
else
{
if ( type == CAR )
printf ( "\nNo parking slot free to park a car\n" ) ;
else
printf ( "\nNo parking slot free to park a scooter\n" ) ;
}
}
else
{
printf ( "Invalid type\n" ) ;
break ;
}
case 2 :
clrscr( ) ;
printf ( "Total vehicles parked: %d\n", vehcount ) ;
printf ( "\nPress any key to continue..." ) ;
getch( ) ;
break ;
case 3 :
clrscr( ) ;
printf ( "Total cars parked: %d\n", carcount ) ;
case 4 :
clrscr( ) ;
printf ( "Total scooters parked: %d\n", scootercount ) ;
printf ( "\nPress any key to continue..." ) ;
getch( ) ;
break ;
case 5 :
clrscr( ) ;
printf ( "Display\n" ) ;
display( ) ;
case 6 :
clrscr( ) ;
printf ( "Departure\n" ) ;
type = 0 ;
case 7 :
clrscr( ) ;
for ( row = 0 ; row < 2 ; row++ )
{
for ( col = 0 ; col < 10 ; col++ )
{
if ( car[row][col] -> num != 0 )
free ( car[row][col] ) ;
if ( scooter[row][col] -> num != 0 )
free ( scooter[row+2][col] ) ;
}
}
finish = 0 ;
break ;
}
}
}
6.0 Skill Developed/ learning out of this Micro-Project