3
answers
0
watching
175
views

Can anyone fix my code so that I have a correct output of ifnomation. Im getting an output of all the car information but nothing abot dealership info which is to be my name, management, contacts ect. Below my C code is all the instructuion that this code is to output.                                                                                                                                               2. I also need a step by step instruction of the code so I can copy and past to word doc so I can properly present explaing the code and whats its to do.  Thank you..                                                                                                                                                                                                                                                                                      include <stdio.h>
#include <stdbool.h>
#include <string.h>

// Define constants for currency conversion rates
#define USD_TO_CAD 1.3
#define USD_TO_MXN 21.0

// Define structs for different features and specifications of a car
struct Engine {
    char type[20];
    int horsepower;
};

struct Chassis {
    int weight;
    double length; // changed to double
};

struct Exterior {
    char color[20];
    bool upgradeableColor;
};

struct SeatingAndTrim {
    char trim1[20];
    char trim2[20];
};

struct Dimensions {
    double height; // changed to double
    double width; // changed to double
};

struct FuelEconomy {
    int cityMPG;
    int highwayMPG;
};

struct Car {
    char model[20];
    char manufacturer[20];
    struct Exterior exterior;
    int mileage;
    bool isAutomatic;
    struct Engine engine;
    struct Chassis chassis;
    struct SeatingAndTrim seatingAndTrim;
    struct Dimensions dimensions;
    bool hasAirbags;
    int numAirbags;
    struct FuelEconomy fuelEconomy;
    bool isHybrid;
    bool isFullyElectrified;
    bool hasAutoParkingAssist;
    bool hasNightVisionAssist;
    bool hasCruiseControl;
    bool is2WD;
    bool hasHillAssist;
    bool hasTPMS;
    bool hasVoiceCommand;
    bool hasLaneChangeIndicator;
    bool hasForwardCollisionWarning;
    bool hasBlindSpotWarning;
    int numSeatHeaters;
    bool hasSteeringHeater;
};

// Create struct for a branch
struct Branch {
    char address[100]; // Increased array size
    char postalCode[10];
    char phoneNumber[20];
    char faxNumber[20];
    char customerServiceEmail[50];
    char gmName[50];
    char gmPhoneNumber[20];
    char gmCellPhoneNumber[20];
    char gmAddress[100]; // Increased array size
    char gmEmail[50];
    char gmDateOfEmployment[20];
    int gmYearsOfExperience;
    char financeManagerFirstName[20];
    char financeManagerLastName[20];
    char financeManagerPhoneNumber[20];
    char financeManagerCellPhoneNumber[20];
    char financeManagerAddress[100]; // Increased array size
    char financeManagerDateOfEmployment[20];
    int financeManagerYearsOfExperience;
    int numAvailableCars;
    struct Car inventory[10]; // Increased array size
};

// Create struct for a transfer
struct Transfer {
    int transferId;
    struct Car car;
    struct Branch sourceBranch;
    struct Branch destinationBranch;
    double transferFee;
    double currencyRate;
};//Corrected the missing value

int main() {
    struct Car exampleCar = {
        .model = "Accord",
        .manufacturer = "Honda",
        .exterior.color = "White / Black",
        .exterior.upgradeableColor = true,
        .mileage = 0,
        .isAutomatic = false,
        .engine.type = "4-cylinder",
        .engine.horsepower = 158,
        .chassis.weight = 2902,
        .chassis.length = 183.1,
        .dimensions.height = 55.7,
        .dimensions.width = 70.8,
        .seatingAndTrim.trim1 = "EX",
        .seatingAndTrim.trim2 = "EX-L Touring V6",
        .hasAirbags = true,
        .numAirbags = 6,
        .fuelEconomy.cityMPG = 32,
        .fuelEconomy.highwayMPG = 42,
        .isHybrid = false,
        .isFullyElectrified = false,
        .hasAutoParkingAssist = false,
        .hasNightVisionAssist = false,
        .hasCruiseControl = true,
        .is2WD = true,
        .hasHillAssist = true,
        .hasTPMS = true,
        .hasVoiceCommand = true,
        .hasLaneChangeIndicator = true,
        .hasForwardCollisionWarning = true,
        .hasBlindSpotWarning = true,
        .numSeatHeaters = 2,
        .hasSteeringHeater = true
    };

    printf("Car Details:\n");
    printf("Model: %s\n", exampleCar.model);
    printf("Manufacturer: %s\n", exampleCar.manufacturer);
    printf("Exterior Color: %s\n", exampleCar.exterior.color);
    printf("Upgradeable Exterior Color: %s\n", exampleCar.exterior.upgradeableColor ? "Yes" : "No");
    printf("Mileage: %d\n", exampleCar.mileage);
    printf("Automatic Transmission: %s\n", exampleCar.isAutomatic ? "Yes" : "No");
    printf("Engine Type: %s\n", exampleCar.engine.type);
    printf("Horsepower: %d\n", exampleCar.engine.horsepower);
    printf("Chassis Weight: %d\n", exampleCar.chassis.weight);
    printf("Chassis Length: %.1f\n", exampleCar.chassis.length);
    printf("Dimensions Height: %.1f\n", exampleCar.dimensions.height);
    printf("Dimensions Width: %.1f\n", exampleCar.dimensions.width);
    printf("Seating and Trim Option 1: %s\n", exampleCar.seatingAndTrim.trim1);
    printf("Seating and Trim Option 2: %s\n", exampleCar.seatingAndTrim.trim2);
    printf("Airbags: %s\n", exampleCar.hasAirbags ? "Yes" : "No");
    printf("Number of Airbags: %d\n", exampleCar.numAirbags);
    printf("Fuel Economy - City MPG: %d\n", exampleCar.fuelEconomy.cityMPG);
    printf("Fuel Economy - Highway MPG: %d\n", exampleCar.fuelEconomy.highwayMPG);
    printf("Hybrid: %s\n", exampleCar.isHybrid ? "Yes" : "No");
    printf("Fully Electrified: %s\n", exampleCar.isFullyElectrified ? "Yes" : "No");
    printf("Auto Parking Assist: %s\n", exampleCar.hasAutoParkingAssist ? "Yes" : "No");
    printf("Night Vision Assist: %s\n", exampleCar.hasNightVisionAssist ? "Yes" : "No");
    printf("Cruise Control: %s\n", exampleCar.hasCruiseControl ? "Yes" : "No");
    printf("2WD: %s\n", exampleCar.is2WD ? "Yes" : "No");
    printf("Hill Assist: %s\n", exampleCar.hasHillAssist ? "Yes" : "No");
    printf("TPMS: %s\n", exampleCar.hasTPMS ? "Yes" : "No");
    printf("Voice Command: %s\n", exampleCar.hasVoiceCommand ? "Yes" : "No");
    printf("Lane Change Indicator: %s\n", exampleCar.hasLaneChangeIndicator ? "Yes" : "No");
    printf("Forward Collision Warning: %s\n", exampleCar.hasForwardCollisionWarning ? "Yes" : "No");
    printf("Blind Spot Warning: %s\n", exampleCar.hasBlindSpotWarning ? "Yes" : "No");
    printf("Number of Seat Heaters: %d\n", exampleCar.numSeatHeaters);
    printf("Steering Heater: %s\n", exampleCar.hasSteeringHeater ? "Yes" : "No");

    return 0;
}                                                                                                                                                                                                                                                                                                                                                                  In this project, you are working on the back end of a famous car dealership website.

The name of the dealership you are working with is your first name and your last name.

Your dealership has 5 different branches in 5 different cities in North America including Canada, USA, and Mexico. Therefore, the offers and prices are in three different currencies.

In case, you need to implement a conversion rate, you can implement a fixed rate; however, implementing a variable rate would be an advantage and you will receive extra points.

As an example, the rate to convert the USD to CAD can be assumed as a fixed rate of 1.3; though in reality, this rate could change from 1.2 to 1.4 on daily basis.

The same as the previous project you have gone through, you need to deal with an inventory.

In this project, each of the branches holds a minimum of 5 cars and a maximum of 10 cars.

The dealership works with the following brands which are divided into three different categories:

Group 1:

- Kia

- Toyota

- Honda

- Mazda

- Nissan



Group 2:

- Ford

- Genesis

- Volvo

- Acura



Group 3:

- BMW

- Audi

- Bentley

- Ferrari

- Aston Martin

- Bugatti



Each car you define MUST have two different trims.



The features and specifications you need to define for the cars are listed below:

- Model

- Manufacturer

- Color (upgradable)

- Mileage

- Manual/Automatic Transmission (upgradable)

- Engine (Engine struct)

- Chassis (Chassis struct)

- Exterior (Exterior struct)

- Seating & Trim (Seating & Trim struct)

- Dimensions (Dimensions struct)

- Airbags (Yes/No)

- number of the Airbags

- Fuel Economy (Fues Struct)

- Hybrid (Yes/No)

- Fully Electrified (Yes/No)

- Automatic Parking Assistance (Yes/No - Upgradable)

- Night Vision Assistance (Yes/No)

- Cruise Control (Yes/No - Upgradable)

- 2WD/4WD

- Hill assist

- Tire Pressure Monitoring System (Yes/No - Upgradable)

- Voice Command

- Lane Change Indicator

- Forward Collision Warning Sensor

- Blind spot warning sensors

- Seat heater (numbers)

- Steering heater (Yes/No)





Each branch has the following public information :

- Address

- Postal Code

- Phone number

- Fax Number

- Customer Service Email

- Name of the General Manager



Each branch has the following confidential information:

- General Manager’s phone number

- General Manager’s cell phone number

- General Manager’s address

- General Manager’s Email

- General Manager’s date of employment

- General Manager’s years of experience

- Finance Manager’s first name and last name

- Finance Manager’s phone number

- Finance Manager’s cell phone number

- Finance Manager’s address

- Finance Manager’s date of employment

- Finance Manager’s years of experience

- Number of the available cars

- Complete Information about the available cars

There are four different stories that your code must represent:

1. One of the branches of the dealership sells a car (The inventory must be updated)

2. One of the branches of the dealership buys a car (The inventory must be updated)

3. One of the branches of the dealership transfers a car from one branch to the other (the transfer expenses and the currency rate must be taken into consideration.)

4. The dealership supplies brand-new cars to the different branches


- All brand-new Honda in Canada has a 2% rebate as a credit.

- All brand-new Volvo above 60,000 in Mexico have a 3% rebate as credit.

- In the USA, there is a loyalty program for BMW, VOLVO, AUDI, BENTLEY, and Ferrari - If the customer is eligible for the loyalty program then a 2.5% promotion will be implemented to their purchase (not a rebate).


Your website has a search engine based on your available inventories of all the branches and the following inputs could be inserted from the user as the search criteria:

1. Car Model

2. Car Manufacturer

3. Brand-new / Used / Both

4. Range of mileage 

5. Price range

6. Color

7. Availability in the country (In this case, you initially need to determine the location)  

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Already have an account? Log in
Avatar image
Read by 1 person
Already have an account? Log in

Related questions

Weekly leaderboard

Start filling in the gaps now
Log in