Homework Help for Information Technology

1,530 results

IT encompasses the study, use, and service of coputers and communication systems for storing, sending, receiving and manipulation data and information

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

Avatar image
sthiyagujan06 asked for the first time

 

C++ Tutorial For Beginners | C++ Programming | C++ | C++ Basics | C++ For Beginners | Simplilearn Simplilearn

c plus plus is a popular programming language introduced by john strawstrom in the year 1979. It is general purpose case sensitive language and it is called pre-compiled language. It contains both features of high level and low level language. C plus plus supports procedural programming and functional programming as well. There are different types of data type that acts as a keyword which is responsible to define a variable. The syntax of strings contains a collection of characters surrounded by double quotes for example here string is the type str is the name of the string and coffee is the value that is assigned to the string. For loop for loop is the repetition control structure that allows us to repeat a block of code for a fixed number of times instead of repeating the same code again and again. Another type of loop is while loop while loop are used in c plus are group of statements that are designed to perform a specific task. functions in c and c plus allow us to write a code inside the function and then we can use that code every time when we need it by mocking the function.

We have to use if condition because we want to find the even elements and the odd elements and for that we have to include if condition so we 'll write if array of i mod 2 that is if an element on dividing by 2 gives 0 as a remainder then it will it is even element so we'll increment the even variable this which we have written 0 will increment over here okay so in this question we have used array for loop and if else so now let 's try some other example. We will print the elements from 1 to 20 using while loop and with the help of function so first of all we 'll start with intermittent and inside int main will simply call or invoke the function by writing the name of the function print function. In order to give some space between each element while printing we have used double quotes with the space between them. Get line c in is used to take the input of a string and s is the name of the string. Now we will print another message saying that you have entered now here we'll print the string so next line and then okay now we 'll do some operations like s dot pushback this will add an element at the end of the. string. There are some more examples on each of these topics we have covered.

Assignment Brief and Guidance:

EMC Cloud Solutions is reputed as the nation’s most reliable Cloud solution provider in Sri Lanka. A number of high-profile businesses in Sri Lanka including Esoft Metro Camps network, SME Bank Sri Lanka and WEEFM are facilitated by EMC Cloud Solutions. EMC Cloud provides nearly 500 of its customers with SaaS, PaaS & IaaS solutions with high-capacity compute and storage options. Also, EMC is a selected contractor for Sri Lanka, The Ministry of Defense for hosting government and defense systems.

EMC’s central data center facility is located at Colombo Sri Lanka along with its corporate head-office in Bambalapitiya. Their premises at Bambalapitiya is a six-story building with the 1st floor dedicated to sales and customer services equipped with public wifi facility. Second-floor hosts HR, Finance and Training & Development departments and the third-floor hosts boardroom and offices for senior executives along with the IT and Data center department. Floor 4,5,6 hosts computer servers which make up the data center.

With the rapid growth of information technology in Kandy area in recent years, EMC seeks opportunity to extend its services to Kandy, Sri Lanka. As of yet, the organization still considers the nature of such extension with what to implement, where is the suitable location and other essential options such as security are actually being discussed.

You are hired by the management of EMC Solutions as a Security Expert to evaluate the security-related specifics of its present system and provide recommendations on security and reliability related improvements of its present system as well as to plan the establishment of the extension on a solid  security foundation.

Activity 01

Assuming the role of External Security Consultant, you need to compile a report focusing on following elements to the board of EMC Cloud Solutions;
Identify types of security risks EMC Cloud is subject to, in its present setup and the impact, such issues would create on the business itself.

Develop and describe security procedures for EMC Cloud to minimize the impact of issues discussed in section (1.1) by assessing and treating the risks.

Activity 02
Discuss how EMC Cloud and its clients will be impacted by improper/ incorrect configurations which are applicable to firewalls and VPN solutions.

Explain how following technologies would benefit EMC Cloud and its Clients by facilitating a ‘trusted network’. (Support your answer with suitable illustrations).
DMZ
Static IP iii) NAT
Discuss the benefits of implementing network monitoring systems.


Activity 03
Formulate a suitable risk assessment procedure for EMC Cloud solutions to safeguard itself and its clients.


Explain the mandatory data protection laws and procedures which will be applied to data storage solutions provided by EMC Cloud. You may also highlight on risk management methodology.

Comment on the topic, ‘IT Security & Organizational Policy’

Lv1
in Information Technology·
18 Apr 2023

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)  

Lv1
in Information Technology·
18 Apr 2023

Hello. Im looking to have someone go over my C code and then send back to me without any errors you find. I realy need this code to give me the output its required too. Its a long code and could be chalenging. Thank you.                                                                                                                                                                                                                                                          #include <stdio.h>
#include <stdlib.h>
#include <string.h>

// Define constants for car prices
#define KIA_PRICE 20000
#define TOYOTA_PRICE 25000
#define HONDA_PRICE 22000
#define MAZDA_PRICE 23000
#define NISSAN_PRICE 24000
#define FORD_PRICE 35000
#define GENESIS_PRICE 40000
#define VOLVO_PRICE 45000
#define ACURA_PRICE 30000
#define BMW_PRICE 50000
#define AUDI_PRICE 55000
#define BENTLEY_PRICE 80000
#define FERRARI_PRICE 100000
#define ASTON_MARTIN_PRICE 90000
#define BUGATTI_PRICE 150000

// Define global variables for car inventory
int kiaInventory = 5;
int toyotaInventory = 3;
int hondaInventory = 2;
int mazdaInventory = 4;
int nissanInventory = 6;
int fordInventory = 7;
int genesisInventory = 2;
int volvoInventory = 3;
int acuraInventory = 5;
int bmwInventory = 4;
int audiInventory = 2;
int bentleyInventory = 1;
int ferrariInventory = 1;
int astonMartinInventory = 0;
int bugattiInventory = 0;

// Define car struct
typedef struct {
    char model[50];
    char manufacturer[50];
    char color[20];
    int mileage;
    char transmission[20];
    char engine[50];
    char chassis[50];
    char exterior[50];
    char seatingTrim[50];
    char dimensions[50];
    int airbags;
    int fuelEconomy;
    int isHybrid;
    int isFullyElectrified;
    int hasAutoParkingAssistance;
    int hasNightVisionAssistance;
    int hasCruiseControl;
    int is2WD;
    int hasHillAssist;
    int hasTPMS;
    int hasVoiceCommand;
    int hasLaneChangeIndicator;
    int hasForwardCollisionWarningSensor;
    int hasBlindSpotWarningSensors;
    int seatHeater;
    int hasSteeringHeater;
} Car;

// Define branch struct
typedef struct {
    char address[100];
    char postalCode[10];
    char phoneNumber[15];
    char faxNumber[15];
    char customerServiceEmail[50];
    char generalManagerName[50];
    char generalManagerPhoneNumber[15];
    char generalManagerCellPhoneNumber[15];
    char generalManagerAddress[100];
    char generalManagerEmail[50];
    char generalManagerDateOfEmployment[20];
    int generalManagerYearsOfExperience;
    char financeManagerName[50];
    char financeManagerPhoneNumber[15];
    char financeManagerCellPhoneNumber[15];
    char financeManagerAddress[100];
    char financeManagerDateOfEmployment[20];
    int financeManagerYearsOfExperience;
    int numAvailableCars;
    Car availableCars[10];
} Branch;

// Define currency conversion rates
float usdToCad = 1.3;
float usdToMxn = 20.0;

// Function prototypes
void displayMenu();
void showCars(Branch branch);
void buyCar(Branch *branch);
void transferCar(Branch *sourceBranch, Branch *destinationBranch);
void supplyCars(Branch *branch);

int main() {
    Branch myBranch; // Replace with your branch name
    strcpy(myBranch.address, "1234 Main St");
    strcpy(myBranch.postalCode, "M5G
#define TOYOTA_CAMRY_PRICE 25000
#define HONDA_CIVIC_PRICE 22000
#define FORD_MUSTANG_PRICE 35000

// Define global variables for car inventory
int toyotaCamryInventory = 5;
int hondaCivicInventory = 3;
int fordMustangInventory = 2;

// Define struct for car information
struct Car {
char model[50];
char manufacturer[50];
char color[20];
int mileage;
int isBrandNew;
float price;
};

// Define struct for branch information
struct Branch {
char address[100];
char postalCode[10];
char phoneNumber[15];
char faxNumber[15];
char customerServiceEmail[50];
char generalManagerName[50];
char generalManagerPhoneNumber[15];
char generalManagerCellPhoneNumber[15];
char generalManagerAddress[100];
char generalManagerEmail[50];
char generalManagerDateOfEmployment[20];
int generalManagerYearsOfExperience;
char financeManagerFirstName[50];
char financeManagerLastName[50];
char financeManagerPhoneNumber[15];
char financeManagerCellPhoneNumber[15];
char financeManagerAddress[100];
char financeManagerDateOfEmployment[20];
int financeManagerYearsOfExperience;
int availableCars;
struct Car carInventory[10];
};

// Define function to display menu
void displayMenu() {
printf("Welcome to Michael Banvill's Car Dealership!\n");
printf("1. Show available cars\n");
printf("2. Buy a car\n");
printf("3. Exit\n");
}

// Define function to show available cars
void showCars(struct Branch *branch) {
printf("Available cars:\n");
for (int i = 0; i < branch->availableCars; i++) {
printf("%d. %s %s - Price: $%.2f, Inventory: %d\n", i + 1, branch->carInventory[i].manufacturer,
branch->carInventory[i].model, branch->carInventory[i].price, branch->carInventory[i].isBrandNew);
}
}

// Define function to buy a car
void buyCar(struct Branch *branch) {
int choice;
printf("Enter the number of the car you want to buy: ");
scanf("%d", &choice);

arduino
Copy code
if (choice < 1 || choice > branch->availableCars) {
    printf("Invalid choice. Please try again.\n");
    return;
}

struct Car *car = &branch->carInventory[choice - 1];

if (car->isBrandNew) {
    printf("You are buying a brand-new car.\n");
    printf("The price is $%.2f.\n", car->price);
} else {
    printf("You are buying a used car.\n");
    printf("The price is $%.2f.\n", car->price * 0.9);
}

printf("Confirm purchase? (1 for Yes, 0 for No): ");
int confirm;
scanf("%d", &confirm);

if (confirm == 1) {
    printf("Thank you for your purchase!\n");
    branch->availableCars--;
} else {
    printf("Purchase canceled.\n");
}
}

int main() {
struct Branch branch1 = {
.address = "1234 Elm Street",
.postalCode = "M1A 1A1",
.phoneNumber = "416-123-4567",
.faxNumber = "416-987-6547",
void transferCar() {
    int sourceBranch, destinationBranch, carChoice, quantity;
    float transferExpense, currencyRate;
    char currency[4];
    
    printf("Enter source branch: ");
    scanf("%d", &sourceBranch);
    printf("Enter destination branch: ");
    scanf("%d", &destinationBranch);
    
    // Get transfer expense and currency rate
    printf("Enter transfer expense: ");
    scanf("%f", &transferExpense);
    printf("Enter currency rate: ");
    scanf("%f", &currencyRate);
    printf("Enter currency (USD, CAD, MXN): ");
    scanf("%s", currency);
    
    printf("Select car to transfer:\n");
    printf("1. Toyota Camry\n");
    printf("2. Honda Civic\n");
    printf("3. Ford Mustang\n");
    scanf("%d", &carChoice);
    
    printf("Enter quantity to transfer: ");
    scanf("%d", &quantity);
    
    // Update inventory of source branch
    switch(carChoice) {
        case 1:
            if(quantity > toyotaCamryInventory) {
                printf("Error: Not enough inventory in source branch.\n");
                return;
            }
            toyotaCamryInventory -= quantity;
            break;
        case 2:
            if(quantity > hondaCivicInventory) {
                printf("Error: Not enough inventory in source branch.\n");
                return;
            }
            hondaCivicInventory -= quantity;
            break;
        case 3:
            if(quantity > fordMustangInventory) {
                printf("Error: Not enough inventory in source branch.\n");
                return;
            }
            fordMustangInventory -= quantity;
            break;
        default:
            printf("Error: Invalid choice.\n");
            return;
    }
    
    // Update inventory of destination branch
    switch(carChoice) {
        case 1:
            toyotaCamryInventory += quantity;
            break;
        case 2:
            hondaCivicInventory += quantity;
            break;
        case 3:
            fordMustangInventory += quantity;
            break;
    }
    
    // Update transfer expenses and currency rate
    switch(carChoice) {
        case 1:
            transferExpense *= currencyRate;
            break;
        case 2:
            transferExpense *= currencyRate;
            break;
        case 3:
            transferExpense *= currencyRate;
            break;
    }
    
    printf("%d car(s) of choice %d transferred from branch %d to branch %d.\n", quantity, carChoice, sourceBranch, destinationBranch);
    printf("Transfer expense: %.2f %s\n", transferExpense, currency);
}

void supplyCars() {
    int branchChoice;
    float rebatePercentage;
    
    printf("Enter branch to supply cars: ");
    scanf("%d", &branchChoice);
    
    printf("Enter rebate percentage: ");
    scanf("%f", &rebatePercentage);
    
    switch(branchChoice) {
        case 1:
            // Apply rebate for brand-new Honda in Canada
            if(rebatePercentage > 0 && rebatePercentage <= 100) {
                toyotaCamryInventory += 5;
                TOYOTA_CAMRY_PRICE *= (1 - rebatePercentage/100);
                printf("Supplying 5 brand-new Toyota Camry to branch %d with a rebate of %.2f%%\n", branchChoice, rebatePercentage);
            } else {
                printf("Error: Invalid rebate percentage.\n");
            }
            break;
        case 2:
            // Apply rebate for brand-new Volvo above $60,000 in Mexico
            if(rebatePercentage > 0 && rebatePercentage <= 100) {
                hondaCivic

Inventory += 3;
HONDA_CIVIC_PRICE *= (1 - rebatePercentage/100);
printf("Supplying 3 brand-new Honda Civic to branch %d with a rebate of %.2f%%\n", branchChoice, rebatePercentage);
} else {
printf("Error: Invalid rebate percentage.\n");
}
break;
case 3:
// Apply rebate for brand-new Ford above $50,000 in USA
if(rebatePercentage > 0 && rebatePercentage <= 100) {
fordMustangInventory += 2;
FORD_MUSTANG_PRICE *= (1 - rebatePercentage/100);
printf("Supplying 2 brand-new Ford Mustang to branch %d with a rebate of %.2f%%\n", branchChoice, rebatePercentage);
} else {
printf("Error: Invalid rebate percentage.\n");
}
break;
default:
printf("Error: Invalid branch choice.\n");
break;
}
}

void displayInventory() {
printf("Inventory at Branch 1 (Canada):\n");
printf("Toyota Camry: %d cars\n", toyotaCamryInventory);
printf("Inventory at Branch 2 (Mexico):\n");
printf("Honda Civic: %d cars\n", hondaCivicInventory);
printf("Inventory at Branch 3 (USA):\n");
printf("Ford Mustang: %d cars\n", fordMustangInventory);
}

int main() {
int choice;

arduino
Copy code
while(1) {
    printf("Car Dealership Inventory System\n");
    printf("1. Transfer car\n");
    printf("2. Supply cars\n");
    printf("3. Display inventory\n");
    printf("4. Exit\n");
    printf("Enter your choice: ");
    scanf("%d", &choice);
    
    switch(choice) {
        case 1:
            transferCar();
            break;
        case 2:
            supplyCars();
            break;
        case 3:
            displayInventory();
            break;
        case 4:
            printf("Exiting...\n");
            return 0;
        default:
            printf("Error: Invalid choice.\n");
            break;
    }
}
}

// Global variables for inventory and prices
int toyotaCamryInventory = 10;
float TOYOTA_CAMRY_PRICE = 25000.0;

int hondaCivicInventory = 8;
float HONDA_CIVIC_PRICE = 22000.0;

int fordMustangInventory = 6;
float FORD_MUSTANG_PRICE = 50000.0;

// Function to transfer cars between branches
void transferCar() {
    int branchFrom, branchTo, carChoice, quantity;
    
    printf("Transfer Car\n");
    printf("Enter branch to transfer from (1-3): ");
    scanf("%d", &branchFrom);
    printf("Enter branch to transfer to (1-3): ");
    scanf("%d", &branchTo);
    
    if(branchFrom < 1 || branchFrom > 3 || branchTo < 1 || branchTo > 3) {
        printf("Error: Invalid branch choice.\n");
        return;
    }
    
    printf("Car Choices:\n");
    printf("1. Toyota Camry\n");
    printf("2. Honda Civic\n");
    printf("3. Ford Mustang\n");
    printf("Enter car choice (1-3): ");
    scanf("%d", &carChoice);
    
    if(carChoice < 1 || carChoice > 3) {
        printf("Error: Invalid car choice.\n");
        return;
    }
    
    printf("Enter quantity to transfer: ");
    scanf("%d", &quantity);
    
    switch(carChoice) {
        case 1:
            if(branchFrom == 1) {
                if(quantity > toyotaCamryInventory) {
                    printf("Error: Insufficient inventory at branch %d.\n", branchFrom);
                } else {
                    toyotaCamryInventory -= quantity;
                    toyotaCamryInventory += quantity;
                    printf("Transferring %d Toyota Camry from branch %d to branch %d.\n", quantity, branchFrom, branchTo);
                }
            } else {
                printf("Error: Car not available at branch %d.\n", branchFrom);
            }
            break;
        case 2:
            if(branchFrom == 2) {
                if(quantity > hondaCivicInventory) {
                    printf("Error: Insufficient inventory at branch %d.\n", branchFrom);
                } else {
                    hondaCivicInventory -= quantity;
                    hondaCivicInventory += quantity;
                    printf("Transferring %d Honda Civic from branch %d to branch %d.\n", quantity, branchFrom, branchTo);
                }
            } else {
                printf("Error: Car not available at branch %d.\n", branchFrom);
            }
            break;
        case 3:
            if(branchFrom == 3) {
                if(quantity > fordMustangInventory) {
                    printf("Error: Insufficient inventory at branch %d.\n", branchFrom);
                } else {
                    fordMustangInventory -= quantity;
                    fordMustangInventory += quantity;
                    printf("Transferring %d Ford Mustang from branch %d to branch %d.\n", quantity, branchFrom, branchTo);
                }
            } else {
                printf("Error: Car not available at branch %d.\n", branchFrom);
            }
            break;
        default:
            printf("Error: Invalid car choice.\n");
            break;
    }
}

// Function to supply cars to branches with rebates
void supplyCars() {
    int branchChoice, carChoice;
    float rebatePercentage;
    
    printf("Supply Cars\n");
    printf("Enter branch to supply to (

// Global variables for inventory and prices
int toyotaCamryInventory = 10;
float TOYOTA_CAMRY_PRICE = 25000.0;

int hondaCivicInventory = 8;
float HONDA_CIVIC_PRICE = 22000.0;

int fordMustangInventory = 6;
float FORD_MUSTANG_PRICE = 50000.0;

// Function to transfer cars between branches
void transferCar() {
    int branchFrom, branchTo, carChoice, quantity;
    
    printf("Transfer Car\n");
    printf("Enter branch to transfer from (1-3): ");
    scanf("%d", &branchFrom);
    printf("Enter branch to transfer to (1-3): ");
    scanf("%d", &branchTo);
    
    if(branchFrom < 1 || branchFrom > 3 || branchTo < 1 || branchTo > 3) {
        printf("Error: Invalid branch choice.\n");
        return;
    }
    
    printf("Car Choices:\n");
    printf("1. Toyota Camry\n");
    printf("2. Honda Civic\n");
    printf("3. Ford Mustang\n");
    printf("Enter car choice (1-3): ");
    scanf("%d", &carChoice);
    
    if(carChoice < 1 || carChoice > 3) {
        printf("Error: Invalid car choice.\n");
        return;
    }
    
    printf("Enter quantity to transfer: ");
    scanf("%d", &quantity);
    
    switch(carChoice) {
        case 1:
            if(branchFrom == 1) {
                if(quantity > toyotaCamryInventory) {
                    printf("Error: Insufficient inventory at branch %d.\n", branchFrom);
                } else {
                    toyotaCamryInventory -= quantity;
                    toyotaCamryInventory += quantity;
                    printf("Transferring %d Toyota Camry from branch %d to branch %d.\n", quantity, branchFrom, branchTo);
                }
            } else {
                printf("Error: Car not available at branch %d.\n", branchFrom);
            }
            break;
        case 2:
            if(branchFrom == 2) {
                if(quantity > hondaCivicInventory) {
                    printf("Error: Insufficient inventory at branch %d.\n", branchFrom);
                } else {
                    hondaCivicInventory -= quantity;
                    hondaCivicInventory += quantity;
                    printf("Transferring %d Honda Civic from branch %d to branch %d.\n", quantity, branchFrom, branchTo);
                }
            } else {
                printf("Error: Car not available at branch %d.\n", branchFrom);
            }
            break;
        case 3:
            if(branchFrom == 3) {
                if(quantity > fordMustangInventory) {
                    printf("Error: Insufficient inventory at branch %d.\n", branchFrom);
                } else {
                    fordMustangInventory -= quantity;
                    fordMustangInventory += quantity;
                    printf("Transferring %d Ford Mustang from branch %d to branch %d.\n", quantity, branchFrom, branchTo);
                }
            } else {
                printf("Error: Car not available at branch %d.\n", branchFrom);
            }
            break;
        default:
            printf("Error: Invalid car choice.\n");
            break;
    }
}

// Function to supply cars to branches with rebates
void supplyCars() {
    int branchChoice, carChoice;
    float rebatePercentage;
    
    printf("Supply Cars\n");
    printf("Enter branch to supply to (

1-3): ");
    scanf("%d", &branchChoice);
    
    if(branchChoice < 1 || branchChoice > 3) {
        printf("Error: Invalid branch choice.\n");
        return;
    }
    
    printf("Car Choices:\n");
    printf("1. Toyota Camry\n");
    printf("2. Honda Civic\n");
    printf("3. Ford Mustang\n");
    printf("Enter car choice (1-3): ");
    scanf("%d", &carChoice);
    
    if(carChoice < 1 || carChoice > 3) {
        printf("Error: Invalid car choice.\n");
        return;
    }
    
    printf("Enter rebate percentage (0-100): ");
    scanf("%f", &rebatePercentage);
    
    if(rebatePercentage < 0 || rebatePercentage > 100) {
        printf("Error: Invalid rebate percentage.\n");
        return;
    }
    
    switch(carChoice) {
        case 1:
            if(branchChoice == 1) {
                printf("Error: Cannot supply cars to the same branch.\n");
            } else {
                if(toyotaCamryInventory == 0) {
                    printf("Error: No Toyota Camry available in inventory.\n");
                } else {
                    toyotaCamryInventory--;
                    float priceWithRebate = TOYOTA_CAMRY_PRICE * (1 - rebatePercentage/100);
                    printf("Supplying 1 Toyota Camry to branch %d with a rebate of %.2f%%. Price with rebate: $%.2f\n", branchChoice, rebatePercentage, priceWithRebate);
                }
            }
            break;
        case 2:
            if(branchChoice == 2) {
                printf("Error: Cannot supply cars to the same branch.\n");
            } else {
                if(hondaCivicInventory == 0) {
                    printf("Error: No Honda Civic available in inventory.\n");
                } else {
                    hondaCivicInventory--;
                    float priceWithRebate = HONDA_CIVIC_PRICE * (1 - rebatePercentage/100);
                    printf("Supplying 1 Honda Civic to branch %d with a rebate of %.2f%%. Price with rebate: $%.2f\n", branchChoice, rebatePercentage, priceWithRebate);
                }
            }
            break;
        case 3:
            if(branchChoice == 3) {
                printf("Error: Cannot supply cars to the same branch.\n");
            } else {
                if(fordMustangInventory == 0) {
                    printf("Error: No Ford Mustang available in inventory.\n");
                } else {
                    fordMustangInventory--;
                    float priceWithRebate = FORD_MUSTANG_PRICE * (1 - rebatePercentage/100);
                    printf("Supplying 1 Ford Mustang to branch %d with a rebate of %.2f%%. Price with rebate: $%.2f\n", branchChoice, rebatePercentage, priceWithRebate);
                }
            }
            break;
        default:
            printf("Error: Invalid car choice.\n");
            break;
    }
}

// Main function
int main() {
    int choice;
    while(1) {
        printf("\nCar Dealership Inventory System\n");
        printf("1. View Inventory\n");
        printf("2. Sell Car\n");
        printf("3. Transfer Car\n");
        printf("4. Supply Cars\n");
        printf("5. Exit\n");
        printf("Enter your choice (1-5): ");
        scanf("%d", &choice);
        
        switch(choice) {
            case 1:
                viewInventory();
                break;
            case 2:
                sellCar();
                break;
            case 3:
                transferCar();
                break;
            case 4:
                supplyCars();
                break;
            case 5:
                printf("Thank you for using the Car Dealership Inventory System. Exiting...\n");
                return 0;
            default:
                printf("Error: Invalid choice. Please try again.\n");
                break;
        }
    }
    return 0;
}                                                                                                                               

Lv1
in Information Technology·
17 Apr 2023

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)  

Avatar image
guruborude24 answered this question
Lv1
in Information Technology·
17 Apr 2023

sorry but has errors.                                                  ERROR!
gcc /tmp/VukZJMpWJP.c -lm
/tmp/VukZJMpWJP.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!' token
    1 | Sure! Here's the complete code with the structs for car features, branch information, and transfer details:
      |     ^
/tmp/VukZJMpWJP.c:1:11: warning: missing terminating ' character
    1 | Sure! Here's the complete code with the structs for car features, branch information, and transfer details:
      |           ^
/tmp/VukZJMpWJP.c:1:11: error: missing terminating ' character
    1 | Sure! Here's the complete code with the structs for car features, branch information, and transfer details:
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:43,
                 from /tmp/VukZJMpWJP.c:5:
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:95:3: error: unknown type name 'size_t'
   95 |   size_t __pad5;
      |   ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:98:67: error: 'size_t' undeclared here (not in a function)
   98 | ar _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
      |                                                               ^~~~~~

/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | /* Copyright (C) 1991-2022 Free Software Foundation, Inc.
In file included from /tmp/VukZJMpWJP.c:5:
/usr/include/stdio.h:308:35: error: expected declaration specifiers or '...' before 'size_t'
  308 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
      |                                   ^~~~~~
/usr/include/stdio.h:314:47: error: expected declaration specifiers or '...' before 'size_t'
  314 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW
      |                                               ^~~~~~
/usr/include/stdio.h:333:34: error: expected declaration specifiers or '...' before 'size_t'
  333 |                     int __modes, size_t __n) __THROW;
      |                                  ^~~~~~
/usr/include/stdio.h:339:24: error: expected declaration specifiers or '...' before 'size_t'
  339 |                        size_t __size) __THROW;
      |                        ^~~~~~
/usr/include/stdio.h:378:44: error: expected declaration specifiers or '...' before 'size_t'
  378 | extern int snprintf (char *__restrict __s, size_t __maxlen,
      |                                            ^~~~~~
/usr/include/stdio.h:382:45: error: expected declaration specifiers or '...' before 'size_t'
  382 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
      |                                             ^~~~~~
In file included from /tmp/VukZJMpWJP.c:5:
/usr/include/stdio.h:633:30: error: expected declaration specifiers or '...' before 'size_t'
  633 |                              size_t *__restrict __n, int __delimiter,
      |                              ^~~~~~
/usr/include/stdio.h:636:28: error: expected declaration specifiers or '...' before 'size_t'
  636 |                            size_t *__restrict __n, int __delimiter,
      |                            ^~~~~~
/usr/include/stdio.h:646:27: error: expected declaration specifiers or '...' before 'size_t'
  646 |                           size_t *__restrict __n,
      |                           ^~~~~~
/usr/include/stdio.h:675:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
  675 | extern size_t fread (void *__restrict __ptr, size_t __size,
      |               ^~~~~
/usr/include/stdio.h:681:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
  681 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
      |               ^~~~~~
/usr/include/stdio.h:702:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread_unlocked'
  702 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
      |               ^~~~~~~~~~~~~~
/usr/include/stdio.h:704:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite_unlocked'
  704 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
      |               ^~~~~~~~~~~~~~~
In file included from /tmp/VukZJMpWJP.c:7:
/usr/include/string.h:44:22: error: expected declaration specifiers or '...' before 'size_t'
   44 |                      size_t __n) __THROW __nonnull ((1, 2));
      |                      ^~~~~~
/usr/include/string.h:47:56: error: expected declaration specifiers or '...' before 'size_t'
   47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:55:32: error: expected declaration specifiers or '...' before 'size_t'
   55 |                       int __c, size_t __n)
      |                                ^~~~~~
/usr/include/string.h:61:42: error: expected declaration specifiers or '...' before 'size_t'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                          ^~~~~~
/usr/include/string.h:64:56: error: expected declaration specifiers or '...' before 'size_t'
   64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:80:60: error: expected declaration specifiers or '...' before 'size_t'
   80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
      |                                                            ^~~~~~
/usr/include/string.h:107:48: error: expected declaration specifiers or '...' before 'size_t'
  107 | extern void *memchr (const void *__s, int __c, size_t __n)
      |                                                ^~~~~~
/usr/include/string.h:145:53: error: expected declaration specifiers or '...' before 'size_t'
  145 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:153:23: error: expected declaration specifiers or '...' before 'size_t'
  153 |                       size_t __n) __THROW __nonnull ((1, 2));
      |                       ^~~~~~
/usr/include/string.h:159:57: error: expected declaration specifiers or '...' before 'size_t'
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |                                                         ^~~~~~
/usr/include/string.h:166:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strxfrm'
  166 | extern size_t strxfrm (char *__restrict __dest,
      |               ^~~~~~~
In file included from /tmp/VukZJMpWJP.c:7:
/usr/include/string.h:179:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strxfrm_l'
  179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
      |               ^~~~~~~~~
/usr/include/string.h:195:45: error: expected declaration specifiers or '...' before 'size_t'
  195 | extern char *strndup (const char *__string, size_t __n)
      |                                             ^~~~~~
/usr/include/string.h:293:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strcspn'
  293 | extern size_t strcspn (const char *__s, const char *__reject)
      |               ^~~~~~~
/usr/include/string.h:297:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strspn'
  297 | extern size_t strspn (const char *__s, const char *__accept)
      |               ^~~~~~
/usr/include/string.h:407:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strlen'
  407 | extern size_t strlen (const char *__s)
      |               ^~~~~~
/usr/include/string.h:413:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'strnlen'
  413 | extern size_t strnlen (const char *__string, size_t __maxlen)
      |               ^~~~~~~
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from /tmp/VukZJMpWJP.c:5:
/usr/include/string.h:432:12: error: expected declaration specifiers or '...' before 'size_t'
  432 | extern int __REDIRECT_NTH (strerror_r,
      |            ^~~~~~~~~~~~~~
In file included from /usr/include/string.h:462,
                 from /tmp/VukZJMpWJP.c:7:
/usr/include/strings.h:34:54: error: expected declaration specifiers or '...' before 'size_t'
   34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                      ^~~~~~
/usr/include/strings.h:38:53: error: expected declaration specifiers or '...' before 'size_t'
   38 | extern void bcopy (const void *__src, void *__dest, size_t __n)
      |                                                     ^~~~~~
/usr/include/strings.h:42:31: error: expected declaration specifiers or '...' before 'size_t'
   42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
      |                               ^~~~~~
/usr/include/strings.h:120:61: error: expected declaration specifiers or '...' before 'size_t'
  120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
      |                                                             ^~~~~~
/usr/include/strings.h:134:27: error: expected declaration specifiers or '...' before 'size_t'
  134 |                           size_t __n, locale_t __loc)
      |                           ^~~~~~
In file included from /tmp/VukZJMpWJP.c:7:
/usr/include/string.h:466:40: error: expected declaration specifiers or '...' before 'size_t'
  466 | extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1))
      |                                        ^~~~~~
/usr/include/string.h:497:55: error: expected declaration specifiers or '...' before 'size_t'
  497 |                         const char *__restrict __src, size_t __n)
      |                                                       ^~~~~~
/usr/include/string.h:500:53: error: expected declaration specifiers or '...' before 'size_t'
  500 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/tmp/VukZJMpWJP.c: In function 'main':
/tmp/VukZJMpWJP.c:128:9: error: expected expression at end of input
  128 |         .isHybrid = false,
      |         ^
/tmp/VukZJMpWJP.c:128:9: error: expected declaration or statement at end of input

Lv1
in Information Technology·
17 Apr 2023

1. Can anyone fix my code so that I have a correct output of ifnomation. 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 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)                                                                                                                       

Lv1
in Information Technology·
17 Apr 2023

I wonder if anyone here can actualy take everything mentioned in this assignment and gerate 1. make a fully working c code.   2. wright a thurow step by step instruction to explain the code in presentation. Good luck!  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)


Start filling in the gaps now
Log in