Only use C for this problem.
To start, create a structure with arrays. Any structure you decide on is ok, just create your own. That said, you are required to meet these guidelines:
1. You must give the structure you make a name. Any is ok
2. Your structure must have at least 3 members.
3. Two of those members must be arrays.
4. Your members need to be of at least two different data-types. To clarify, your members cannot be integers only (or floats, or doubles only).
5. As a restriction, your member names cannot be make, mileage, model or price.
Now that you have defined your structure, you will declare one structure of this type inside main. Next, initialize all its members by asking the user. Say for instance if you were asking for a car's model, name, the price, or the make name (no need of functions in this task, and again don't give your members those names). When done scanning the information from the user, print it at the end of main. Good luck!
#include<stdio.h>
struct Car{
char name[100];
double good[1];
float bad[1];
};
int main() {
struct Car c;
printf("Enter Car's name:" );
scanf("%s",&c.name);
printf("Enter Car's price:" );
scanf("%lf",&c.good[0]);
printf("Enter Car's model:" );
scanf("%f",&c.bad[0]);
printf("CAR DETAILS:\n");
printf("Name :%s\n",c.name);
printf("Price :%lf\n",c.good[0]);
printf("Model :%f\n",c.bad[0]);
return 0;
}
OUTPUT:
Get Answers For Free
Most questions answered within 1 hours.