Please answer fully in C programming (pointers). -------------------------------
ID: 3878257 • Letter: P
Question
Please answer fully in C programming (pointers).
-----------------------------------------
#include
#include
#define MAX_STR 32
#define MAX_VEHICLES 4
#define MAX_CUSTOMERS 6
typedef struct {
// ADD MEMBER VARIABLES
} VehicleType;
typedef struct {
// ADD MEMBER VARIABLES
} CustomerType;
void print_vehicle(VehicleType *v) {
//add code here!!!
}
int main() {
CustomerType customers[MAX_CUSTOMERS];
return 0;
}
Defined structures This program makes use of two structures that need to be completed. The first is the VehicleType structure. This structure will contain all of the data for each car owned by the customers. This structure will have fields for the following pieces of data: e . . . make (string) model (string) colour (string) year (int) mileage (int) The second structure (CustomerType) will contain all of the data regarding the individual customers. It will have the following fields: first name (string) . last name (string) . number of vehicles registered with the shop (int) . a Vehicle Type array storing the individual vehicles owned by the customer (declared to have a length of MAX_VEHICLESExplanation / Answer
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <string>
using namespace std;
#define MAX_STR 32
#define MAX_VEHICLES 4
#define MAX_CUSTOMERS 6
typedef struct {
string make;
string model;
string colour;
int year;
int mileage;
} VehicleType;
typedef struct {
string fname;
string lname;
int numVeh;
VehicleType numVehCust[MAX_VEHICLES];
} CustomerType;
void print_vehicle(VehicleType *v) {
std::cout << "Make: "<<v->make<<"Model: "<<v->model<<"Colour: "<<v->colour<<"Year: "<<v->year<<"Mileage: "<<v->mileage << std::endl;
}
int main() {
CustomerType customers[MAX_CUSTOMERS];
return 0;
VehicleType *vh;
vh->make = "Honda";
vh->model = "City";
vh->colour = "Black";
vh->year = 1992;
vh->mileage = 45;
std::cout<<"Hello";
print_vehicle(vh);
}