Question: heres my code in C #include #include #include #include int main(void) { char title[50]; char col1[50]; char col2[50]; int point[50]; char names[50][50] = {'0'}; int

heres my code in C

#include #include #include #include int main(void) { char title[50]; char col1[50]; char col2[50]; int point[50]; char names[50][50] = {'\0'}; int count = 0; char dataPoint[50]; int commas = 0; int i = 0, j = 0, k = 0, p = 0, len; char integerValue[5] = ""; int commaAfterInt = 0; printf("Enter a title for the data: "); fgets (title, 50, stdin); printf("You entered: %s ", title); printf("Enter the column 1 header: "); fgets (col1, 50, stdin); printf("You entered: %s ", col1); len = strlen(col1); if (len > 0 && col1[len-1] == ' ') { col1[--len] = '\0'; } printf("Enter the column 2 header: "); fgets (col2, 50, stdin); printf("You entered: %s ", col2); while (count 1) { printf("Error: Too many commas in input. "); } else if (commaAfterInt == 1) { printf("Error: Comma not followed by an integer. "); } else { point[count++] = atoi(integerValue); k = 0; p = 0; strcpy(names[count], ""); while(dataPoint[p] != ',') { names[count][k] = dataPoint[p]; k++; p++; } names[count][k] = '\0'; names[count][k+1] = '\0'; printf("Data string: %s ", names[count]); printf("Data integer: %d ", point[count-1]); printf(" ");

} }

printf("%33s ", title); printf("%20s | %23s ", col1, col2); printf("-------------------------------------------"); i = 0; while (i

printf(" %-20s |\t%20d ", names[i], point[i]); i++; }

return 0; }

I need the end of the code to look like this

heres my code in C #include #include #include #include int main(void) {

char title[50]; char col1[50]; char col2[50]; int point[50]; char names[50][50] = {'\0'};

5) Output the information in a formatted table. The title is right justified with a width of 33. Column 1 has a width of 20. Column 2 has a width of 23. (3 pts) EX: Number of Novels Auth red Auth r name Number of novels Jane Austen Charles Dickens Ernest HemingwayI Jack Kerouac F. Scott Fitzgerald I Mary Shelley Charlotte Bronte I Mark Twain Agatha Christie Ian Flemming J.K. Rowling Stephen King Oscar Wilde 20 73 14 14 54 1 Jane Austen ** Charles Dickens Ernest Hemingway".. Jack Kerouac F. Scott Fitzgerald Mary Shelley Mark Twain Ian Flemming J.K. Rowling Stephen King Oscar Wilde

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!