Vanessa purchased a stock one year ago and sold it today for…

Questions

Vаnessа purchаsed a stоck оne year agо and sold it today for $3.15 per share more than her purchase price. She received a total of $2.60 per share in dividends. Which one of the following statements is correct in relation to this investment?

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the file name into a string, with the appropriate mode. (10%) Open the file, provided as input for both reading & writing, and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (15%) Go through the array and calculate the MINIMUM, and MAXIMUM grade of SECOND homework, and the student name.  (5%) Append the student ID, name, and the MINIMUM value at the end of the file. (5%) Append the student ID, name, and the MAXIMUM value at the end of the file. Following is the sample output file for the given input file example. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 The MINIMUM grade for HW2 is scored by Mary. The MAXIMUM grade for HW2 is scored by Jane Doe. (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the file name into a string, with the appropriate mode. (10%) Open the file, provided as input for both reading & writing, and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (15%) Go through the array and calculate the MINIMUM, and MAXIMUM grade of FOURTH homework, and the student name.  (5%) Append the student ID, name, and the MINIMUM value at the end of the file. (5%) Append the student ID, name, and the MAXIMUM value at the end of the file. Following is the sample output file for the given input file example. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 The MINIMUM grade for HW4 is scored by John Doe. The MAXIMUM grade for HW4 is scored by Mary. (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the input and output file names into two different strings, with the appropriate mode. (10%) Open the input file, provided as input for reading and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (5%) Close the input file being read. (10%) Open the output file, provided as input for writing and check if it was opened successfully. If not, "return -2". (10%) Go through the array and calculate the AVERAGE grade out of the 4 homeworks, for each student. Write the student ID, name, and the calculated value into the output file. Following is the sample output file for the given input file example. 1,John Doe,18 2,Jane Doe,27 3,Mary,17 (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the input and output file names into two different strings, with the appropriate mode. (10%) Open the input file, provided as input for reading and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (5%) Close the input file being read. (10%) Open the output file, provided as input for writing and check if it was opened successfully. If not, "return -2". (10%) Go through the array and calculate the MINIMUM grade out of the 4 homeworks, for each student. Write the student ID, name, and the calculated value into the output file. Following is the sample output file for the given input file example. 1,John Doe,18 2,Jane Doe,27 3,Mary,17 (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the file name into a string, with the appropriate mode. (10%) Open the file, provided as input for both reading & writing, and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (15%) Go through the array and calculate the MINIMUM, and MAXIMUM grade of FIRST homework, and the student name.  (5%) Append the student ID, name, and the MINIMUM value at the end of the file. (5%) Append the student ID, name, and the MAXIMUM value at the end of the file. Following is the sample output file for the given input file example. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 The MINIMUM grade for HW1 is scored by John Doe, and Mary. The MAXIMUM grade for HW1 is scored by Jane Doe. (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

Cоnsider this blоck оf code below. Trаce the following code аs explаined in class. Show the starting address and the intermediate and final values of the variables. A variable of type ‘int’ takes 4 bytes and any pointer variable takes 8 bytes of space. Assume the starting address that is available is 1000 (calculate in decimal).  For each of the starting addresses there is only one number, please write that down. However, for each of the variable values there can be more than one value (starting, intermediate, and final). Write all of them down, separated by a comma. For example, if one value has 3 values then write them down as 1, 2, 3.   int X = 2, Y = 3, Z = 4; int* p; int** pp; int arr[ 5 ] = { 6, 5, 4, 3, 2 }; p = &X; *p += 2; pp = &p; **pp = 3; p = &arr[ 1 ]; *p = 10; p += 1; *p = 20; p = &arr[ 4 ]; arr[ *p + 1 ] = 30;   Starting address location is 1000 (calculate in decimal) Variable Name Starting Address Value X [S1] [V1] Y [S2] [V2] Z [S3] [V3] p [S4] [V4] pp [S5] [V5] array value at index 0 [S6] [V6] array value at index 1 [S7] [V7] array value at index 2 [S8] [V8] array value at index 3 [S9] [V9] array value at index 4 [S10] [V10]

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the input and output file names into two different strings, with the appropriate mode. (10%) Open the input file, provided as input for reading and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (5%) Close the input file being read. (10%) Open the output file, provided as input for writing and check if it was opened successfully. If not, "return -2". (10%) Go through the array and calculate the MAXIMUM grade out of the 4 homeworks, for each student. Write the student ID, name, and the calculated value into the output file. Following is the sample output file for the given input file example. 1,John Doe,18 2,Jane Doe,27 3,Mary,17 (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

Assume thаt yоu hаve а CSV file which cоntains the infоrmation for each student and the scores for 4 homeworks. The structure for the data is - student ID, student Name, hw1, hw2, hw3, hw4. See the example below. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 Write the code that does the following: (10%) Student struct definition given the input data. Assume that name can be up to 20 characters and all other data values are integers. The struct definition must be written at the top outside main or any other function. (10%) Read the file name into a string, with the appropriate mode. (10%) Open the file, provided as input for both reading & writing, and check if it was opened successfully. If not, "return -1". (15%) Go through the file once and calculate the number of lines in the file. Assume, there is NO header row. (5%) Dynamically allocate the array for the Student struct.  (15%) Read the file again and store the data into the dynamically created array above.  (15%) Go through the array and calculate the MINIMUM, and MAXIMUM grade of ALL homeworks, and the student name.  (5%) Append the student ID, name, and the MINIMUM value at the end of the file. (5%) Append the student ID, name, and the MAXIMUM value at the end of the file. Following is the sample output file for the given input file example. 1,John Doe,20,30,28,18 2,Jane Doe,35,50,27,36 3,Mary,17,20,34,44 The LOWEST total is scored by John Doe. The HIGHEST is scored by Jane Doe. (5%) Close the output file. (5%) Free the dynamically allocated array and end the main function. Assumptions: You are writing this code in ONLY ONE file - main.c. And there are no other files in the project. You can create functions if you would like to, but are not required to do so.

(10 pоints) Write а functiоn implementаtiоn which tаkes two integer pointers as input, and swaps the two numbers.  The prototype of the function is: void swap_numbers(int*, int*);   (15 points) Consider the following code in main: int main(int argc, char* arg[]) {   int n;   int* address = NULL;   printf("Enter the number of integers to read: ");   scanf("%d", &n);   allocate_memory(&address, n);   printf("The starting address of the allocated memory is: %pn", address); } Write a function implementation which takes a pointer to an integer pointer, and an integer as input, and dynamically allocate the memory. The prototype of the function is: void allocate_memory(int**, int);  (5 points) Explain why int* is not sufficient in allocate_memory()?