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

Write a C++ program (cars.cpp) that uses a one dimensional string array, cars to

ID: 3536940 • Letter: W

Question

Write a C++ program (cars.cpp) that uses a one dimensional string array, cars to store the names of 10 car manufacturers. Prompt the user to enter the name of 10 car manufacturers and using a loop read the names of the car manufacturers in to the array, cars (Use loops, the getline method to read the string (do not use cin method here) and use the index number for the arrays in your codeThen print a message saying %u201CThe cars manufacturers you entered are%u201C and print the list you just entered into the array (Use loops and the index number of array in your code %u2013 see Printing an array). Use string header file in source code.

Explanation / Answer

#include<iostream>

using namespace std;

#include<string>

int main()

{

string car[10];

int i;

cout<<"Enter the car manufacturer company : "<<endl;

for(i=0;i<10;i++)

getline(cin,car[i]);

cout<<"you Entered the following car manufacturer company : "<<endl;

{for(i=0;i<10;i++)

cout<<car[i]<<endl;

}

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote