guruborude24

guruborude24

Lv6

guruborude24Indian Institute of Information Technology, Design and Manufacturing - IIITDM Kancheepuram

0 Followers
8 Following
3 Helped

ANSWERS

Published68

Subjects

History1English1Business1Science1Nursing1Information Technology3Computer Science6Accounting8Calculus1Mathematics1Statistics3Physics2Chemistry39

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

Answer: I apologize for the errors in my previous response. It seems that ther...
Answer: here is your answer in step by step way so you can understand it in be...
Answer: here is your answer in step by step way so you can understand it in be...
Answer: here is your answer instep by step way so you can understand it better...
Answer: here is your answer in step by step way so you can understand it bette...
Answer: here is your answer in step by step way so you can understand it bette...

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)                                                                                                                       

Answer: here is your answer in step by step way so you can understand it bette...
Answer: here is answer in step by step way so you can understand in better way...
Answer: here is your answer in step by step way so you can understand it in be...
Answer: here is your answer in step by step way so you can understand it in be...
Answer: here is your answer step by step way so you can understand it in bette...
Answer: here is your answer in step by step way so you can understand in best ...
Answer: here is your answer in step by step way please check it out The percen...
Answer: here is your answer in step by step way please check it out The percen...
Answer: here is your answer in step by step way please check it out To find th...
Answer: here is your answer in step by step way please check it out To find th...
Answer: here is your answer in step by step format please check it out To find...
Answer: here is your answer in step by step format please check it out To find...
Answer: here is your answer in step by step way please check it out and enjoy ...
Answer: here is your answer in step by step way please check it outStep-by-ste...
Answer: here is your answer in step by step way please check it outStep-by-ste...
Answer: here is your answer in step by step wayStep-by-step explanation: 1- If...
Answer: Sure, here's the solution to your problem:Step-by-step explanation: Th...

Answer: To find all angles between 0 and 360 degrees that satisfy the equation...
Answer: One example of a non-computer algorithm used in everyday life is a rec...
Answer: Step-by-step explanation: The formula for finding the pH of a strong b...
Answer: here's the solution to your question: in step by step way enjoy it Ste...
Answer: Enough of a monoprotic acid is dissolved in water to produce a 1.40 M ...
Answer: Enough of a monoprotic acid is dissolved in water to produce a 0.0197 ...
Answer: enough of a monoprotic acid is dissolved in water to produce a 0.0197 ...
Answer: To find the Ka of the acid, we need to use the Henderson-Hasselbalch e...
Answer: here is answer of this (a) To calculate the molar mass of the acid, we...
Answer: Here's a Python program to get the cumulative sum of the elements of a...
Answer: As an AI language model, I cannot create visual grids. However, I can ...
Answer: To solve this problem, we can use the following steps:Step-by-step exp...
Answer: here's a Python program that calculates the difference between two lis...
Answer: The following code uses a for loop to iterate over each character in t...
Answer: Sure! Here's a Python program that accepts a string from the user and ...
Answer: To find the molar mass of the acid, we first need to determine the num...
Answer: here is answer in step by step way full answer is for you (a) To deter...

Weekly leaderboard

Start filling in the gaps now
Log in