Question

Only use C for this problem. To start, create a structure with arrays. Any structure you...

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!

Homework Answers

Answer #1
#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:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Create a class called BirthYear. It should only have two member, both of them arrays. One...
Create a class called BirthYear. It should only have two member, both of them arrays. One of type string called Names. The second of type int called BirthYears. in your main class create a StudentBirthYear object. Make sure both arrays are of the size 10. Add ten different names and ten different birth years. Then display each name with its birth year using only 1 for loop. (You can display in a for loop as well as a foreach loop,...
Please write it in c# program please and if possible no arrays only loops Loop Introduction...
Please write it in c# program please and if possible no arrays only loops Loop Introduction Assignment Using the conditions below, write one program that calculates a person’s BMI. Your main() function will call functions 1, 2, and 3. Your program will contain three functions: Function #1: Will ask the user for their weight in pounds and their height in inches.   Your function will convert the weight and height into Body Mass Index (BMI). The formula for converting weight into...
In c++ create a class to maintain a GradeBook. The class should allow information on up...
In c++ create a class to maintain a GradeBook. The class should allow information on up to 3 students to be stored. The information for each student should be encapsulated in a Student class and should include the student's last name and up to 5 grades for the student. Note that less than 5 grades may sometimes be stored. Your GradeBook class should at least support operations to add a student record to the end of the book (i.e., the...
Your C program will do the following : Must use at least 2 function prototypes &...
Your C program will do the following : Must use at least 2 function prototypes & definitions . You can also use repetitions , control structures . You re not allowed any type of global arrays, or global variables. You are only allowed to use 2 dimensional arrays. 1. In your main program, create a array of size 7 X 7. 2. Create a function that accepts the empty array. The function will initiate the to zero. Then, the function...
n this lab, you use what you have learned about parallel arrays to complete a partially...
n this lab, you use what you have learned about parallel arrays to complete a partially completed C++ program. The program should: Either print the name and price for a coffee add-in from the Jumpin’ Jive Coffee Shop Or it should print the message Sorry, we do not carry that. Read the problem description carefully before you begin. The file provided for this lab includes the necessary variable declarations and input statements. You need to write the part of the...
Hi, please could someone be of assistance with this assignment for me. Thank you The objective...
Hi, please could someone be of assistance with this assignment for me. Thank you The objective of this assignment is to practice the use of control objects in GUI design. You are required to create a 4- function calculator. See pic below. Calculator.png The calculator should have buttons for all 10 numbers, the decimal point, the four operations (+,-,/,*), an equal “=” button, a "main display" (TextBox or RichTextBot), a backspace button and a clear “C” button. When you create...
Create a new NetBeans project (using Ant) titled YourNameExam2P3. 2. Pretend you are a malware author...
Create a new NetBeans project (using Ant) titled YourNameExam2P3. 2. Pretend you are a malware author and you are trying to come up with random-looking web domain names for your command-and-control viruses, e.g. “RDf-45dlfjxg7.com”. 3. First, you need to come up with some original criteria that define your domain name pattern. For example, “it should be 13 characters long, include 3 integers only, no lower case letters, and possibly end in .net or .edu”. You should come up with your...
--USING C# ONLY-- You will create your own on-line shopping store in the console application. You...
--USING C# ONLY-- You will create your own on-line shopping store in the console application. You can choose different products to sell in your store (at least 8 products). You will create an product inventory text file. The program will display two options at the beginning of the program, Customer and Manager. Customer: If this is a new customer, the program will allow the customer to register with their information and assign a unique ID number to the new customer....
This is C++ Note, for part 2 of this assignment, you DO NOT NEED to use...
This is C++ Note, for part 2 of this assignment, you DO NOT NEED to use arrays or vectors. All changes, calculations, etc should be performed in place ( in the file). You may need one or two structures that temporary hold data needed to be displayed, changed, etc. Part 2: Binary Files Write a program that uses a structure to store the following inventory data in a file: The data can be either read from a text file or...
-Data Structure in C++ (Review for C++) -using vector and class In this assignment you’re going...
-Data Structure in C++ (Review for C++) -using vector and class In this assignment you’re going to build a simple “register machine”, a kind of minimal computer that only supports storing a fixed number of values (i.e., no randomly-accessible “main memory”). Your machine will consist of an input loop that reads lines of input from the user and then executes them, stopping when the user quits (by executing the stop command). Each line of input consists of a command followed...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • Nursing Care of Patient with Peptic Ulcer Disease Abstract: Cedric Filmore, age 40, is transferred to...
    asked 19 minutes ago
  • describe the three fiscal policy tools at the government's disposal to stimulate or contract the economy....
    asked 42 minutes ago
  • i) Write the condensed electron configurations for the following ions: (a) Ca+ (b) S2- (c) V2+...
    asked 42 minutes ago
  • In Java a function can call itself(we may explore more about this later in the course).  This...
    asked 55 minutes ago
  • Write a short program,Java, that implements the Caesar substitution cipher with k=3. That is, each letter...
    asked 57 minutes ago
  • Design a function named findMax that accepts two integer values as arguments and returns the value...
    asked 1 hour ago
  • In MIPS, I am trying to create an array of 7 words that can either be...
    asked 1 hour ago
  • Cash, $2,000 Accounts Receivable, $1,250 Professional Equipment, $10,200 Office Equipment, $5,500 Accounts Payable, $3,500 P. Palmer,...
    asked 1 hour ago
  • Add two more statements to main() to test inputs 3 and -1. Use print statements similar...
    asked 1 hour ago
  • C++ program called that reads a string and check if it’s well-formed or not. ex== The...
    asked 1 hour ago
  • 1: Describe five functions of nonverbal communication. (Creating and maintaining relationships, Regulating Interaction, Influencing others, Concealing/deceiving,...
    asked 1 hour ago
  • Trucks that travel on highways have to stop at various locations to be weighed and inspected...
    asked 1 hour ago