Question: C language This in-class exercise is another partner activity, which requires two students to form one team and work together to solve the problems as

C language  C language This in-class exercise is another partner activity, which requires

This in-class exercise is another partner activity, which requires two students to form one team and work together to solve the problems as follows: For problems 1, 4, and 6: Partner 1 - write the code while describing your thought process to your partner; Partner 2 - analyze your partner's code as he/she is developing it and ask appropriate questions to help your partner generate the correct code. For problems 2, 3, and 5: Partner 2 - write the code while describing your thought process to your partner; Partner 1 - analyze your partner's code as he/she is developing it and ask appropriate questions to help your partner generate the correct code. You may use either the Microsoft Visual Studio or the ZDE in zyBooks as the development environment for this exercise. 1. Struct type data: Complex number is not one basic data type in C. Define your own struct type named ComplexNum for complex numbers, then define two variables c_1 and c_2 for the newly defined type. Try to read the values of c_1 and c_2 from input and calculate the sum and store it in new variable c_3. 2. Struct and function: Write a function called multlplyComplexNumber to return the product of two complex numbers. This function has two ComplexNum typed parameters and returns one ComplexNum typed value. 3. Simple pointers: In main(), define three integer variables named a, b, and c, three double variables named x, y, and z, one pointer variable named ptrint that points to integer data, and one pointer variable named ptrDbl that points to double data. Try to assign the address of normal integer/double variables to the two pointers, assign new values to the data item pointed by the pointers using indirection operator, and check the changes to the normal variables. Can you assign the address of x to print? 4. Pointer and array: Implement a function named myStrChr with the same functionality as the strchi() function. It has two parameters: the first is a pointer to char that specifies the siring to be searched, the second is the target character. This function returns the address for the first occurrence of target character if successful and NULL if not. Requirement: Do NOT use strchr() function. 5. Pointer and struct: Implement a function named conjugateComplexNumber to change the input complex number to its conjugate, i.e. the imaginary part's sign will be flipped. It has one parameter that is the pointer to one ComplexNum type data. 6. Pointer and dynamic allocation: Implement a function named readOneArray that reads the user specified array size, allocates one int array dynamically, reads its values, and returns this array as a pointer to int data. Requirement: The array size shall also be passed back to the caller function

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!