Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This assignment has three simple programs. 1. Write a program named DynamicStruc

ID: 3683734 • Letter: T

Question

This assignment has three simple programs.

1. Write a program named DynamicStructs. Create a data structure for automobiles. It should have the name of the car, the color, etc. Dynamically allocate a data structure, ask the user to enter the information from within a function named EnterInfo, then display the information in a function named DisplayInfo.

2. Write a program named CompareStrings. You will need two char arrays, name them one and two, and have enough room for single words. Ask the user to enter two words (lower case), compare the words, and say if the first word is before or after the second word in lexigraphical order.

3. Create a program named DynamicList. Create a data structure for classes at UCF. It should have the class identifier such as COP3223 and other information such as the department. Create a linked list of four classes from within a function named CreateList. Now display all items in list from a function named WalkListAndDisplay.

Zip the source code for all three programs and submit.

the four classes to use for number 3 are

psy2023-college of sciences

psb3002-college of sciences

psb3842-college of sciences

clp3184-college of sciences

Explanation / Answer

Write a program named DynamicStructs. Create a data structure for automobiles.

It should have the name of the car, the color, etc. Dynamically allocate a data structure, ask the user to enter the information from within a function named EnterInfo, then display the information in a function named DisplayInfo.

Answer

#include <iostream>

using namespace std;

struct automobiles{

    char color;

    char name[50];

   // define other attributes

};

//struct variables creation

struct automobiles firstauto,secondauto;

//EnterInfo

void EnterInfo(automobiles automob);

//DisplayInfo

void DisplayInfo(automobiles automob);

int main ()

{

automobiles am;

am = EnterInfo(am);

cout << "My auto mobile is: ";

DisplayInfo(firstauto);

cout << "And yours is: ";

DisplayInfo(secondauto);

return 0;

}

void EnterInfo(automobiles am1){

    cout<<"Enter Car Name:"<<endl;

    //up to 50 characters

    cin.get(am1.name,50);

    cout<<"Enter Car Color"<<endl;

    cin>>am1.color;

}

void DisplayInfo(automobiles amob)

{

     cout << amob.name;

     cout << " " <<amob.color << " ";

}