Homework Help for Information Technology

1,538 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
yeabfrew464 asked for the first time
Avatar image
nithiesh062001 asked for the first time
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;
}                                                                                                                               


Start filling in the gaps now
Log in