Answer to Question #98039 in C++ for Vilman Miranda Lopez

Question #98039
#include <iostream>
#include <string>
using namespace std;

string to_string(string array[], int size);

int main()
{
const string alpha = "abcdefghijklmnopqrstuvwxyz";
const int SIZE = 26;
string letters[SIZE];

for (int i =0; i<SIZE; i++)
{
char letters[SIZE] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
cout<<letters[SIZE];
}
cout << to_string(letters, SIZE) << endl;
}

/**
Returns a string array as a delimited string.
@param a the array of strings.
@param size the size of the array.
@return a string of the elements, separated by
commas and surrounded by [].
*/
string to_string(string a[], int size)
{
string result = "[";
if (size > 0)
{
result = result + "\"" + a[0] + "\"";
for (int i = 1; i < size; i++)
{
result = result + ", \"" + a[i] + "\"";
}
}
result = result + "]";
return result;
}
1
Expert's answer
2019-11-05T05:53:42-0500
Dear Vilman Miranda Lopez, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS