I need help in solving the question highlighted in bold for C language.
Given-
struct tag {
char ch;
int i;
};
struct bTag{
float f;
double d;
};
struct cTag{
struct aTag a;
struct bTagb;
int A[5];
};
typedef struct aTag aType;
typedef struct bTag bType;
typedef struct cTag cType;
aType a, A[5];
bType b, B[5];
cType c, C[5];
aType *pa;
bType *pb;
cType *pc;
1a). Implement a function void InputFunc1(cType *ptr) that will input via scanf() the members of the structure pointed to by ptr. Assume that the memory space already exist.
b). Implement a function cType InputFunc2(void) that will declare a local variable as cType temp. The function will then input the values of the members of temp using scanf(). Finally, the function will return temp.
c) Implement a function void InputFunc3(cType C[], int n) that will input via scanf() the elements of the array of structure C. Parameter n represents the number of elements in the array.
d) Implement a function void OutputFunc1(cType *ptr) that will output the members of the structure pointed to by ptr. Assume that the memory space already exist and that the values of the structure are valid. Use dereference operator and structure member operator only. DO NOT use the structure pointer operator ->.
e). Implement a function void OutputFunc2(cType*ptr) similar to the previous problem. The difference here is that it is required to use the structure pointer operator ->.
f). Implement a function void OutputFunc 3(c Type C[ ], int n) that will output the elements of array C using array indexing.
Step by stepSolved in 3 steps
- check the image for question and answer according to C++ Programming Langugagearrow_forwardDefine a structure type to represent a common fraction. Write a program that gets a fraction and displays both the fraction and the fraction reduced (by using greatest common divisor (GCD) function) to lowest terms using the following code fragment: The fraction is supposed to have a numerator and denominator.Code fragment: //starts here frac = get_fraction(); print_fraction(frac); printf(" = "); print_fraction(reduce_fraction(frac)); // ends herearrow_forwardThe following struct types have been defined: typedef struct { int legs; char *sound; char *name; } pet_t; typedef struct { char *name; int age; pet_t *pet; } owner_t; A variable kid has been defined by: owner_t *kid; Functions get_owner and get_pet have the prototypes: owner_t *get_owner(char *,int,pet_t *); pet_t *get_pet (char *name, char *sound, int legs); Using kid, print a line like: Julie's pet parrot has 2 legs and says, "squawk".arrow_forward
- JAVA Data type Java assignment meaning of operator int float double and string Pick one Java polymorphic arithmetic operator and write Java code statements that demonstrate its function for ints, floats, doubles, and strings. Also, indicate what role the operator is performing in the table below.arrow_forwardIn C language. Please don't copy similar programs from, bartleby or chegg Define a structure type auto_t to represent an automobile. Include components for the make and model (strings), the odometer reading, the manufacture and purchase dates (use another user-defined type called date_t), and the gas tank (use a user-defined type tank_t with components for tank capacity and current fuel level, giving both in gallons). Write I/O functions scan_date, scan_tank, scan_auto, print_date, print_tank, and print_auto, and also write a driver function that repeatedly fills and displays an auto structure variable until input is -30. Note: Each record has a number (1, 2, 3 ...),once the program scans record number -30, it should terminate without processing it. SAMPLE RUN #4: ./Structures Interactive Session Show Invisibles Highlight: Enter record number:1 Enter Make:Mercury Enter Model:Sable Enter Odometer Reading:99842 Enter Month:1 Enter Day:18 Enter Year:2001 Enter Month:5 Enter Day:30…arrow_forwardIn C++ struct applianceType { string supplier; string modelNo; double cost; }; applianceType myNewAppliance; applianceType applianceList[25]; Write the C++ statements that prints out all the appliance info from applianceList whose modelNo is B1234.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY