Question: Instructions: C++ a) Use scanf function to accept the input from the user. b) Use floating point inputs wherever possible. 1. a) Define a structure

 Instructions: C++ a) Use scanf function to accept the input from

Instructions: C++ a) Use scanf function to accept the input from the user. b) Use floating point inputs wherever possible. 1. a) Define a structure with the tag Consumption to consist of a character array (city[20], an integer (year), and a double (usage) b) Define a structure with the tag Resource to consist of two character arrays (material [30], and units[20]), and three doubles (longitude, latitude, and quantity) Then in the main function, declare metal and fuel to be variables of type struct Resource, and then declare water and power to be variables of type struct Consumption Declare one more variable wood of type struct Resource with the members of wood to be initialized as per Table I:| TABLE I. Member for structure variable wood material[30] longitude latitude uantit units 20] Value Oak 32.5 13.2 5e+8 hectares Then, use the dot operator (.) or special string functions (wherever applicable) to assign the following values to the members of the various structure variables as per Table II TABLE II. Variable name Member name longitude latitude uantit material units Value 57.3 32.1 3e+10 Iron cubic meters metal Then use the printf0 function to print all these numerical values using their respective data type placeholders Finally, use the scanfO function to input numerical values from the user regarding the values of the following members (a) fuel Then print these values which were given as input by the user using the printfO function. Note: When you use special string functions, you have to use the #include

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!