Answered! The program should: use a table-like 2-D array (i.e., an array of 'strings') to record the inputs use loop to read inputs…

Write a C program.

Reads user information in, outputs modified version.

The program should: use a table-like 2-D array (i.e., an array of strings) to record the inputs use loop to read inputs (from standard in), one input per line, about the user information in the form of name age wage, where age is an integer literal, and wage is a floating point literal with 1 decimal number. See sample input below store each input string into the current available row of the 2D array, starting from the row 0 create a modified string of the input, and store it in the next row of the 2D array. In the modified version of input, a letters in name are capitalized, age becomes age 10 and wage has 50% increases and is formatted with 2 digits after decimal point. continue reading input, until a name xxx is entered after reading all the inputs, output the 2-D array row by row, displaying each original input followed by the modified version of the input. display the current date and time and program name before generating the output, using predefined marcos such as TIME

INCOMPLETE CODE

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>

#define ROWS 20
#define COLUMNS 30

int main(int argc, char *argv[])
{
char inputs_table [ROWS][COLUMNS];

int id, age;
double wage;

printf(“Enter name age and wage: “);
scanf(“%s %d %lf”, name, &age, &wage);

while (….)
{

…..
/* read again */
printf(“Enter name age and wage: “);
scanf(“%s %d %lf”, name, &age, &wage );

}

/* now use a loop to display the input_table row by row */
……
……

return 0;
}

The program should: use a table-like 2-D array (i.e., an array of ‘strings’) to record the inputs use loop to read inputs (from standard in), one input per line, about the user information in the form of name age wage, where age is an integer literal, and wage is a floating point literal with 1 decimal number. See sample input below store each input string into the current available ‘row’ of the 2D array, starting from the row 0 create a modified string of the input, and store it in the next row of the 2D array. In the modified version of input, a letters in name are capitalized, age becomes age 10 and wage has 50% increases and is formatted with 2 digits after decimal point. continue reading input, until a name xxx is entered after reading all the inputs, output the 2-D array row by row, displaying each original input followed by the modified version of the input. display the current date and time and program name before generating the output, using predefined marcos such as TIME

Expert Answer

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>

#define ROWS 20
#define COLUMNS 30
#define __FILENAME__ (strrchr(__FILE__, ‘\’) ? strrchr(__FILE__, ‘\’) + 1 : __FILE__)
struct node{
char name[COLUMNS];
int age;
double wage;
};
int main(int argc, char *argv[])
{
struct node rec[ROWS];

int i=0, age;
double wage;
char name[100];

while (1)
{

/* read again */
printf(“Enter name age and wage: “);
scanf(“%s %d %lf”, rec[i].name, &rec[i].age, &rec[i].wage );
//checking name is xxx
if(strcmp(rec[i].name,”xxx”)==0){
break;
}
i++;
}
//printing filename,date,time
printf(“Records Generated in %s on %s %sn”,__FILENAME__,__DATE__,__TIME__);

int j=0;
for(j=0;j<i;j++){
printf(“%s %d %.2lfn”,rec[j].name,rec[j].age,rec[j].wage);
strupr(rec[j].name);//converting name into upper case
printf(“%s %d %.2lfn”,rec[j].name,rec[j].age+10,rec[j].wage*1.5);

}
/* now use a loop to display the input_table row by row */
return 0;
}

Still stressed from student homework?
Get quality assistance from academic writers!