ktipu619

ktipu619

Lv5

Tipu KhanUniversity of Engineering and Management - UEM

0 Followers
0 Following
1 Helped

ANSWERS

Published93

Subjects

Business56Information Technology24Calculus6Mathematics1Statistics4Physics2

Would you please help me fix/edit my below C code to output everything from the attached assignment below my C code.  If you could please read the step by step in the project as its very detailed and long. I really need a 100% completed code. Thx.

---------------------------------------------------------------------------------

#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;
    int length;
};

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

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

struct Dimensions {
    int height;
    int width;
};

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;
};

sstruct Branch exampleBranch = {
    .address = "1234 Main St",
    .postalCode = "A1B 2C3",
    .phoneNumber = "123-456-7890",
    .faxNumber = "987-654-3210",
    .customerServiceEmail = "[email protected]",
    .gmName = "John Doe",
    .gmPhoneNumber = "111-222-3333",
    .gmCellPhoneNumber = "444-555-6666",
    .gmAddress = "5678 Elm St",
    .gmEmail = "[email protected]",
    .gmDateOfEmployment = "01/01/2010",
    .gmYearsOfExperience = 10,
    .financeManagerFirstName = "Jane",
    .financeManagerLastName = "Doe",
    .financeManagerPhoneNumber = "777-888-9999",
    .financeManagerCellPhoneNumber = "000-111-2222",
    .financeManagerAddress = "9876 Oak St",
    .financeManagerDateOfEmployment = "02/02/2015",
    .financeManagerYearsOfExperience = 6,
    .numAvailableCars = 10,
    .inventory = {exampleCar, exampleCar, exampleCar, exampleCar, exampleCar,
                  exampleCar, exampleCar, exampleCar, exampleCar, exampleCar}
};

// Calculate the price after applying rebate or promotion
double price = 50000;
const char* model = "Honda";
const char* manufacturer = "Honda";
const char* country = "Canada";
double convertedPrice = convertCurrency(price, country);
double finalPrice = applyRebateOrPromotion(convertedPrice, model, manufacturer, country);

printf("Original Price

// Function to calculate price after applying rebate or promotion
double applyRebateOrPromotion(double price, const char* model, const char* manufacturer, const char* country) {
    if (strcmp(model, "Honda") == 0 && strcmp(country, "Canada") == 0) {
        return price * 0.98; // 2% rebate for Honda in Canada
    }
    else if (strcmp(manufacturer, "Volvo") == 0 && price > 60000 && strcmp(country, "Mexico") == 0) {
        return price * 0.97; // 3% rebate for Volvo above 60,000 in Mexico
    }
    else if ((strcmp(manufacturer, "BMW") == 0 || strcmp(manufacturer, "Volvo") == 0 ||
        strcmp(manufacturer, "Audi") == 0 || strcmp(manufacturer, "Bentley") == 0 ||
        strcmp(manufacturer, "Ferrari") == 0) && strcmp(country, "USA") == 0) {
        return price * 0.975; // 2.5% promotion for eligible brands in USA
    }
    return price;
}

--------------------------------------------------------------------------------

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)

Answer: I can help you edit your C code to output everything from the attached...

Can anyone complete my code?    // Constants for fixed currency conversion rates
#define USD_TO_CAD_RATE 1.3
#define USD_TO_MXN_RATE 19.9

// Constants for promotion rates
#define CAN_HONDA_REBATE 0.02
#define MEX_VOLVO_REBATE 0.03
#define USA_LOYALTY_PROMOTION 0.025

// Constants for inventory
#define MIN_CARS_PER_BRANCH 5
#define MAX_CARS_PER_BRANCH 10

// Constants for car groups and their brands
#define NUM_GROUPS 3
#define MAX_BRANDS_PER_GROUP 6
const char *CAR_GROUPS[NUM_GROUPS] = {"Group 1", "Group 2", "Group 3"};
const char *CAR_BRANDS[NUM_GROUPS][MAX_BRANDS_PER_GROUP] = {
    {"Kia", "Toyota", "Honda", "Mazda", "Nissan"},
    {"Ford", "Genesis", "Volvo", "Acura", NULL},
    {"BMW", "Audi", "Bentley", "Ferrari", "Aston Martin", "Bugatti"}
};

// Constants for car features
#define MAX_MODEL_LENGTH 50
#define MAX_COLOR_LENGTH 20
#define MAX_TRANSMISSION_LENGTH 20
#define MAX_ENGINE_LENGTH 50
#define MAX_CHASSIS_LENGTH 50
#define MAX_EXTERIOR_LENGTH 50
#define MAX_SEATING_TRIM_LENGTH 50
#define MAX_DIMENSIONS_LENGTH 50
#define MAX_FUEL_LENGTH 50
#define MAX_NUM_AIRBAGS 10
#define MAX_PHONE_LENGTH 20
#define MAX_EMAIL_LENGTH 50
#define MAX_ADDRESS_LENGTH 100
#define MAX_NAME_LENGTH 50
#define MAX_BRANCHES 5
#define MAX_CARS_PER_BRANCH 10

// Structs for car features
typedef struct {
    char model[MAX_MODEL_LENGTH];
    char manufacturer[MAX_NAME_LENGTH];
    char color[MAX_COLOR_LENGTH];
    int mileage;
    char transmission[MAX_TRANSMISSION_LENGTH];
    char engine[MAX_ENGINE_LENGTH];
    char chassis[MAX_CHASSIS_LENGTH];
    char exterior[MAX_EXTERIOR_LENGTH];
    char seating_trim[MAX_SEATING_TRIM_LENGTH];
    char dimensions[MAX_DIMENSIONS_LENGTH];
    int has_airbags;
    int num_airbags;
    char fuel_economy[MAX_FUEL_LENGTH];
    int is_hybrid;
    int is_fully_electrified;
    int has_automatic_parking;
    int has_night_vision;
    int has_cruise_control;
    int is_4wd;
    int has_hill_assist;
    int has_tire_pressure_monitoring;
    int has_voice_command;
    int has_lane_change_indicator;
    int has_forward_collision_warning;
    int has_blind_spot_warning;
    int num_seat_heaters;
    int has_steering_heater;
} Car;

// Structs for branch information
typedef struct {
    char address[MAX_ADDRESS_LENGTH];
    char postal_code[MAX_ADDRESS_LENGTH];
    char phone_number[MAX_PHONE_LENGTH];
    char fax_number[MAX_PHONE_LENGTH];
    char customer_service_email[MAX_EMAIL_LENGTH];
    char general_manager_name[MAX_NAME_LENGTH];
    char general_manager_phone[MAX_PHONE_LENGTH];
    char general_manager_cell_phone[MAX_PHONE_LENGTH];
    char general_manager_address[MAX_ADDRESS_LENGTH];
    char general_manager_email[MAX_EMAIL_LENGTH];
    char general_manager_date_of_employment[MAX_ADDRESS_LENGTH];
    int general_manager_years_of_experience;
    char finance_manager_name[MAX_NAME_LENGTH];
    char finance_manager_phone[MAX_PHONE_LENGTH];
    char finance_manager_cell_phone[MAX_PHONE_LENGTH];
    char finance_manager_address[MAX_ADDRESS_LENGTH];
   
// Struct for inventory management
typedef struct {
Car cars[MAX_CARS_PER_BRANCH];
int num_cars;
} Inventory;

// Function to convert USD to CAD
float convert_to_cad(float usd_amount) {
return usd_amount * USD_TO_CAD_RATE;
}

// Function to convert USD to MXN
float convert_to_mxn(float usd_amount) {
return usd_amount * USD_TO_MXN_RATE;
}

// Function to calculate rebate for a car based on the country and brand
float calculate_rebate(char* country, char* brand) {
float rebate = 0.0;
if (strcmp(country, "Canada") == 0 && strcmp(brand, "Honda") == 0) {
rebate = CAN_HONDA_REBATE;
} else if (strcmp(country, "Mexico") == 0 && strcmp(brand, "Volvo") == 0) {
rebate = MEX_VOLVO_REBATE;
} else if (strcmp(country, "USA") == 0) {
rebate = USA_LOYALTY_PROMOTION;
}
return rebate;
}

// Function to check if a given car is available in a given branch
int is_car_available(Inventory* inventory, char* model, char* manufacturer) {
int i;
for (i = 0; i < inventory->num_cars; i++) {
if (strcmp(inventory->cars[i].model, model) == 0 && strcmp(inventory->cars[i].manufacturer, manufacturer) == 0) {
return 1;
}
}
return 0;
}

// Main function
int main() 
}

// Sample usage of the structs and functions
Inventory toronto_inventory = {
.num_cars = 3,
.cars = 
{
.model = "Civic",
.manufacturer = "Honda",
.color = "Black",
.mileage = 5000,
.transmission = "Automatic",
.engine = "2.0L",
.chassis = "Sedan",
.exterior = "Sunroof",
.seating_trim = "Leather",
.dimensions = "Compact",
.has_airbags = 1,
.num_airbags = 6,
.fuel_economy = "City: 8.5 L/100 km, Hwy: 6.2 L/100 km",
.is_hybrid = 0,
.is_fully_electrified = 0,
.has_automatic_parking = 1,
.has_night_vision = 0,
.has_cruise_control = 1,
.is_4wd = 0,
.has_hill_assist = 1,
.has_tire_pressure_monitoring = 1,
.has_voice_command = 1,
.has_lane_change_indicator = 1,
.has_forward_collision_warning = 1,
.has_blind_spot_warning = 1,
.num_seat_heaters = 2,
.has_steering_heater = 1
},

.model = "Corolla",
.manufacturer = "Toyota",
.color = "Blue",
.mileage = 7000,
.transmission = "Automatic",
.engine = "1.8L",
.chassis = "Sedan",
.exterior = "Alloy Wheels",
.seating_trim = "Cloth",
.dimensions = "Compact",
.has_airbags = 1,
.num

Answer:It seems that the main function is incomplete. What would you like to a...

Review the following case study and answer the questions at the end of the case study. 
MoMP CobIT Case Study

While attending one of the ISACA continuous professional education (CPE) sessions related to optimizing IT spending using COBIT 5 practices, it was surprising to realize that many IT audit and assurance professionals who attended the session confided having difficulty in initiating governance of enterprise IT (GEIT) and wished they had more insight on where to begin when implementing GEIT in their respective organization. This article describes the experience of initiating GEIT at the 

The Primary Stakeholders
The MoMP was established to regulate the labor market by providing stable work environments with a productive national workforce with the contribution from all three stakeholders (government, employers and employees) and to increase the percentage of national man power in the private sector to enhance its role in supporting the national economy. One of the objectives of MoMP is building an integrated labor market informational system and preparing the national labor force register with the aim of developing human resources (HR) in the country and ensuring their optimum utilization.

The Information Technology Authority (ITA), Sultanate of Oman, was established to implement national IT infrastructure projects and supervise all projects related to implementation of the Digital Oman Strategy while providing professional leadership to various other e-governance initiatives of the Sultanate. ITA serves as a competency center on best practices in e-governance and in harnessing information and communication technologies (ICTs), thereby offering efficient and timely services, integrating processes, and improving efficiency in service delivery.

The Background
In alignment with the eOman e-Transformation vision of 2020 as part of the Digital Oman Strategy, ITA mandated services provided by all the Ministries to be transformed into electronic format and, consequently, qualifying as many as 145 key government services that MoMP provides to the sponsors (companies), residents (expatriates) and citizens (Omani nationals) as part of the e-governance initiative.

As a response to the mandate, MoMP’s network and information security department and systems and applications development department set out to first implement an information security management system (ISMS) across the entire Ministry, adopting ISO/IEC 27001:2005 in 2010 and, subsequently, getting certified in 2011. It took the initiative until 2012 to setup a project management department as a provision to effectively and efficiently manage several IT projects associated with MoMP e-Transformation Strategy. The project management department adopted a combination of the Projects in Controlled Environments version 2 (PRINCE2) methodology and the Project Management Institute’s A Guide to the Project Management Body of Knowledge (PMBOK Guide) for the project management system (PMS). Additionally, it adopted Information Technology Infrastructure Library version 3 (ITIL V3), as an ITSM methodology to manage the IT services provided to the internal and external stakeholders, and to manage the e-services provided to the MoMP beneficiaries.

The Challenges
The biggest challenge was the unstructured awareness, absence of training and the knowledge gap of IT governance among the stakeholders within MoMP. The situation was made trickier due to the prevalence of inaccurate information and incorrect perceptions about the term “governance” itself. The “unlearning” and “relearning” was quite an uphill task, and it took a majority of the time and efforts.

ITA also acknowledged1 the challenges of obsolete technologies, lack of sharing of infrastructure and data, ad hocapplication development and manual government services. As a solution, it introduced an enterprise architecture framework specifically designed for ministries and other government entities. The framework was aptly titled the Oman e-Governance Architecture Framework (OeGAF), a set of standards/best practices and process management systems to enhance the delivery of government services in alignment with the mission of ITA.

At MoMP, the ISMS was already quite mature and generally accepted by the stakeholders; however, since the PMS and the ITSM were relatively new, there were mixed feeling about the effectiveness and value of additional systems. Furthermore, there were concerns raised about additional paperwork and documentation related to these 2 systems, which were perceived as a burden to an already overloaded MoMP staff of more than 5,000 employees across numerous branches, locations and directorates.

Another challenge was that while the ISMS was more prescriptive in nature, the PMS and the ITSM were more adaptive, more like guidelines. Hence, initially the ISMS team was somewhat reluctant to cooperate with the other two teams, fearing noncompliance in their control objectives.

Choosing a Framework
The PMS team realized that their current role needed enhancement to address the challenges at hand. Hence, it was transformed into a functional IT project and program management office (IT PMO), within the network and information security department and the systems and applications development department.

After conducting carefully facilitated workshops with the identified stakeholders, the IT PMO eased all fears and reluctance relating to common pain areas, and common functional and organizational objectives. Eventually, the ISMS and IT PMO teams joined hands forming the process engineering group (PEG) as a potential IT governance implementation team.

One of the critical points of initial discussions was how to integrate the external mandates, along with 3 somewhat divergent management systems (ISMS, ITSM and PMS). Some of the other points raised were: who would be held responsible and accountable for the different interdependent functional duties and who would provide direction for the strategies.

The PEG team was tasked to research, review and analyse the drivers and the pain areas. It determined that the gap or the missing piece was IT governance, especially since MoMP had already embarked on the e-governance journey. Various options for implementing IT governance and available frameworks were categorically and systematically reviewed and, finally, the PEG recommended COBIT 5 as the solution for the implementation of GEIT, specifically its 5 principles 

 

⦁ Who are the stakeholders and how did they go about identify them? (what activity was conducted)

Answer: The case study is about the initiation of governance of enterprise IT ...

Heres the projest. I have to have output of exactly as the projest explains / requires. Thx.

 

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)

Answer:Alright, I understand that you need help with a project that involves b...

Hi. I added the struct you generated for my project code. However im still getting only output for vehicle info but no county, sity, contact, address etc.  Can you please help me get the exact output I need for this project to be completed? Also here is the entire code all together. Thx.          #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;
};
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;
}

Answer: It seems like you forgot to add the struct Branch to your code. You ne...

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)  

Answer: To fix your code, you need to add the dealership information to your c...

Hi. I will provide this project to you so it may help you see what I'm trying to get the C code to do. Hope this helps.                                                                          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)  

Answer: You could start by defining a struct for the branch information, which...
Answer: Sure, here's an example implementation of the ParkingMeter class in Ja...
Answer: Sure, here's an example program in Java that asks the user to input nu...
Answer: Sure, here's an example program in Python that asks the user to input ...
Answer: Sure, here's an example program in Python that contains a function cal...
Answer: Sure, here's an example program in Python to input a string from the u...
Answer: Sure, here's an example program in Python to demonstrate the uses of d...
Answer: Sure, here's an example program in Python to separate list items in a ...
Answer: Sure, here's an example program in Python to display odd and even inte...
Answer: Sure, here's an example program in Python to display the minimum of tw...
Answer: An augmented assignment operator is a shorthand way of performing an a...
Answer: Sure, here's an example program in Python to print the factorial of a ...
Answer: Sure, here's an example program in Python to demonstrate the use of th...
Answer: Sure, here's an example of how to use the rstrip() method in Python: S...
Answer: In Python, an error handler is known as an exception handler. It is a ...

hHi again. I revoved the errors but now am recieving new errors? I took a snapshot below code. Thx again.

 

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <time.h>



// Define the maximum length of a string.

#define MAX_LENGTH 100



// Define the number of items in each category.

#define NUM_MEAT 2

#define NUM_DELI 2

#define NUM_PHARMACY 2

#define NUM_SEAFOOD 2

#define NUM_BEVERAGE 2

#define NUM_CANNED 2

#define NUM_JARRED 2

#define NUM_DRY_FOOD 2

#define NUM_DAIRY 2

#define NUM_BAKERY 2

#define NUM_PERSONAL_CARE 2

#define NUM_PAPER_GOODS 2



// Define the number of categories.

#define NUM_CATEGORIES 12



// Define the durable life period of each category.

#define DURABLE_LIFE_PERIOD_MEAT 5

#define DURABLE_LIFE_PERIOD_DELI 4

#define DURABLE_LIFE_PERIOD_PHARMACY 2

#define DURABLE_LIFE_PERIOD_SEAFOOD 3

#define DURABLE_LIFE_PERIOD_BEVERAGE 6

#define DURABLE_LIFE_PERIOD_CANNED 8

#define DURABLE_LIFE_PERIOD_JARRED 10

#define DURABLE_LIFE_PERIOD_DRY_FOOD 12

#define DURABLE_LIFE_PERIOD_DAIRY 7

#define DURABLE_LIFE_PERIOD_BAKERY 2

#define DURABLE_LIFE_PERIOD_PERSONAL_CARE 9

#define DURABLE_LIFE_PERIOD_PAPER_GOODS 14



// Define the encryption key for encryption method 1.

#define ENCRYPTION_KEY_1 "zyxwvutsrqponmlkjihgfedcba"



// Define the encryption key for encryption method 2.

#define ENCRYPTION_KEY_2 "nopqrstuvwxyzabcdefghijklm"



// Define the encryption key for encryption method 3.

#define ENCRYPTION_KEY_3 "plmoknijbuhvygctfxrdzeswaq"



// Define the encryption key for encryption method 5.

#define ENCRYPTION_KEY_5 "abcdefghijklmnopqrstuvwyxz"



// Define the encryption key for encryption method 6.

#define ENCRYPTION_KEY_6 "0123456789"



// Define the encryption key for encryption method 7.

#define ENCRYPTION_KEY_7 "USD"



// Define the number of digits for the barcode.

#define BARCODE_LENGTH 10



// Define the number of items in the store.

#define NUM_ITEMS (NUM_MEAT + NUM_DELI + NUM_PHARMACY + NUM_SEAFOOD + NUM_BEVERAGE + NUM_CANNED + NUM_JARRED + NUM_DRY_FOOD + NUM_DAIRY + NUM_BAKERY + NUM_PERSONAL_CARE + NUM_PAPER_GOODS)



// Define the struct for an item.

struct Item {

    char name[MAX_LENGTH];

    char category[MAX_LENGTH];

    char company[MAX_LENGTH];

    double purchased_price;

    double sale_price;

    int quantity;

    char date_purchased[MAX_LENGTH];

    char date_production[MAX_LENGTH];

    char expiry_date[MAX_LENGTH];

    int store_code;

    char currency[MAX_LENGTH];

    char barcode[BARCODE_LENGTH + 1];

};

 

Answer:Hello again! I don't see any errors in the code you provided. However, ...

Can someone help me fix/edit my below C code to output everything from the attached assignment below my C code.  If you could please read the step by step in the project as its very detailed and long. I realy need a 100% completed code. Thx.

---------------------------------------------------------------------------------

#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;
    int length;
};

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

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

struct Dimensions {
    int height;
    int width;
};

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;
};

sstruct Branch exampleBranch = {
    .address = "1234 Main St",
    .postalCode = "A1B 2C3",
    .phoneNumber = "123-456-7890",
    .faxNumber = "987-654-3210",
    .customerServiceEmail = "[email protected]",
    .gmName = "John Doe",
    .gmPhoneNumber = "111-222-3333",
    .gmCellPhoneNumber = "444-555-6666",
    .gmAddress = "5678 Elm St",
    .gmEmail = "[email protected]",
    .gmDateOfEmployment = "01/01/2010",
    .gmYearsOfExperience = 10,
    .financeManagerFirstName = "Jane",
    .financeManagerLastName = "Doe",
    .financeManagerPhoneNumber = "777-888-9999",
    .financeManagerCellPhoneNumber = "000-111-2222",
    .financeManagerAddress = "9876 Oak St",
    .financeManagerDateOfEmployment = "02/02/2015",
    .financeManagerYearsOfExperience = 6,
    .numAvailableCars = 10,
    .inventory = {exampleCar, exampleCar, exampleCar, exampleCar, exampleCar,
                  exampleCar, exampleCar, exampleCar, exampleCar, exampleCar}
};

// Calculate the price after applying rebate or promotion
double price = 50000;
const char* model = "Honda";
const char* manufacturer = "Honda";
const char* country = "Canada";
double convertedPrice = convertCurrency(price, country);
double finalPrice = applyRebateOrPromotion(convertedPrice, model, manufacturer, country);

printf("Original Price

// Function to calculate price after applying rebate or promotion
double applyRebateOrPromotion(double price, const char* model, const char* manufacturer, const char* country) {
    if (strcmp(model, "Honda") == 0 && strcmp(country, "Canada") == 0) {
        return price * 0.98; // 2% rebate for Honda in Canada
    }
    else if (strcmp(manufacturer, "Volvo") == 0 && price > 60000 && strcmp(country, "Mexico") == 0) {
        return price * 0.97; // 3% rebate for Volvo above 60,000 in Mexico
    }
    else if ((strcmp(manufacturer, "BMW") == 0 || strcmp(manufacturer, "Volvo") == 0 ||
        strcmp(manufacturer, "Audi") == 0 || strcmp(manufacturer, "Bentley") == 0 ||
        strcmp(manufacturer, "Ferrari") == 0) && strcmp(country, "USA") == 0) {
        return price * 0.975; // 2.5% promotion for eligible brands in USA
    }
    return price;
}

--------------------------------------------------------------------------------

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)

 

Answer: It seems like your code is incomplete and there are some missing parts...
Answer: Of course, I'm here to help. What do you need assistance with related ...
Answer:C. Interest paid to bondholders represents a tax-deductible business ex...
Answer: ⭕ Liability
Answer: c. doesn't have experience developing management systems. Buying a fra...
Answer:It is not clear which book is being referred to in this question. Pleas...
Answer: B. employees assume more responsibility. To implement a policy of empo...
Answer: a. Ethical behavior can not only enhance a company's reputation but ca...
Answer: Chapter 5 of the book "Fundamentals of Business" by Stephan J. Skripak...
Answer:E. Business marketers normally deal with far fewer but far larger buyer...
Answer:a. Ownership rights are easily transferred.
Answer: A) Double taxation is normally considered a disadvantage of the corpor...
Answer:C) limited liability of stockholders is an advantage of the corporate f...
Answer: Cherokee, Incorporated Traditional Income Statement Sales revenue: $18...
Answer: Gig Harbor Boating Budgeted Income Statement Sales revenue: ($52,140 x...
Answer: To calculate the target selling price, we need to add up all the costs...
Answer: C.they create value through convenience and lower prices. Manufacturer...
Answer: Wholesalers and retailers are two types of intermediaries that play a ...

Weekly leaderboard

Start filling in the gaps now
Log in