39 lines
No EOL
1.1 KiB
C
39 lines
No EOL
1.1 KiB
C
/*----------------------------------------------------------
|
|
* HTBLA-Leonding
|
|
* ---------------------------------------------------------
|
|
* Author: Marc Tismonar
|
|
* ----------------------------------------------------------
|
|
* Description:
|
|
* Car demo project.
|
|
* ----------------------------------------------------------
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include "car.h"
|
|
#define TOTAL_CARS 6
|
|
|
|
void print_car(Car car, int index);
|
|
|
|
int main(int argc, char const *argv[]) {
|
|
Car cars[TOTAL_CARS];
|
|
cars[0] = get_car(AIXAM);
|
|
cars[1] = get_car(FIAT_MULTIPLA);
|
|
cars[2] = get_car(FIAT_MULTIPLA);
|
|
cars[3] = get_car(FIAT_MULTIPLA);
|
|
cars[4] = get_car(JEEP);
|
|
cars[5] = get_car(JEEP);
|
|
|
|
for (int i = 0; i < TOTAL_CARS; i++) {
|
|
print_car(cars[i], i);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void print_car(Car car, int index) {
|
|
printf("%d. Car: ", index + 1);
|
|
printf("Type: %d, ", get_type(car));
|
|
printf("Color: %d, ", get_color(car));
|
|
printf("Fill Level: %.1f, ", get_fill_level(car));
|
|
printf("Acceleration Rate: %.2f, ", get_acceleration_rate(car));
|
|
printf("Speed: %d\n", get_speed(car));
|
|
} |