Exercise: 1. Match the number with the appropriate label. Label : a. Structure members b. Initialization of all of the structure members for the variable wood c. Structure tag d. Initialization of structure variable's members e. Structure definition f. Reading and printing structure members. g. Declarations of variables of structure types 1 include sinclude struct Consumption{ char city[20): int year; double usage; 2 3 struct Resource char material[30]; double logitude; double latitude; double quantity; char units[20); 2 4 int main(O{ struct Resource metal, fuel: struct Resource wood ={tOak", 32.5, 13.2, 5e+8, "hectares"}; struct Consumption water, power; metal.logitude = 57-3: metal.latitude = 32.1; metal.quantity = 3e+10; strepy(metal.material, "Iron"); strepy(metal.units, "cubic meters"); 6. printf("The metal information is: \n%s\n%4.1lf degress longitude\n%4.1lf degress" "latitude\n%4e %s\n\n",metal.material, metal.logitude, metal.latitude, metal.quantity, metal.units); printf("Enter water and power : \ncity, year and usage\n"); scanf("%s%d%lf%s%d%ir,&water.city, &water.year, &water.usage,&power.city,&power.year,&power.usage); 7 printf("\n\nThe water and power are : \n%s\n%d\n%4.01f million liters\n\n%s\n%d\n%4.01lf mega watts\n", water.city, water.year, water.usage.power.city.power.year.power.usage); 2. Develop a complete program for currency conversion rate as defined in Table 1. In main function, your program should prompt the currency conversion selection, and the USD value should be received through user input. Then, the conversion selection and USD value will pass to function name as convert. The convert function is used to convert the currency from USD into other currency according to conversion selection. The conversion value will return to called function. 3.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 2PP
icon
Related questions
Question
Exercise:
1. Match the number with the appropriate label.
Label :
a. Structure members
b. Initialization of all of the structure members for the variable wood
c. Structure tag
d. Initialization of structure variable's members
e. Structure definition
f. Reading and printing structure members.
g. Declarations of variables of structure types
1
include <stdio.h>
sinclude <string.h>
struct Consumption{
char city(20);
int year;
double usage;
2
};
struct Resource
char material[30];
double logitude;
double latitude;
double quantity;
char units[20);
2
4
int main({
struct Resource metal, fuel:
struct Resource wood ={fOak", 32.5, 13.2, 5e+8, "hectares"};
struct Consumption water, power;
metal.logitude 57-3:
metal.latitude = 32.1;
metal.quantity 3e+10;
strepy(metal.material, "Iron"):
strepy(metal.units, "cubic meters");
6
printf( The metal information is : \n%s\n%4.1lf degress longitude\n%4.alf degress"
"latitude\n%4e %s\n\n",metal.material, metal.logitude, metal.latitude, metal.quantity,
metal.units);
printf("Enter water and power : \ncity, year and usage\n");
scanf("%s%d%If%s%d%If",&water.city, &water.year,
&water.usage,&power.city,&power.year,&power.usage);
7
printf("\n\nThe water and power are : \n%s\n%d\n%4.0if million
liters\n\n%s\n%d\n%4.01lf mega watts\n",
water.city, water.year, water.usage,power.city,power.year.power.usage);
2. Develop a complete program for currency conversion rate as defined in Table 1. In main
function, your program should prompt the currency conversion selection, and the USD
value should be received through user input. Then, the conversion selection and USD value
will pass to function name as convert. The convert function is used to convert the currency
from USD into other currency according to conversion selection. The conversion value
will return to called function.
3.
3.
Transcribed Image Text:Exercise: 1. Match the number with the appropriate label. Label : a. Structure members b. Initialization of all of the structure members for the variable wood c. Structure tag d. Initialization of structure variable's members e. Structure definition f. Reading and printing structure members. g. Declarations of variables of structure types 1 include <stdio.h> sinclude <string.h> struct Consumption{ char city(20); int year; double usage; 2 }; struct Resource char material[30]; double logitude; double latitude; double quantity; char units[20); 2 4 int main({ struct Resource metal, fuel: struct Resource wood ={fOak", 32.5, 13.2, 5e+8, "hectares"}; struct Consumption water, power; metal.logitude 57-3: metal.latitude = 32.1; metal.quantity 3e+10; strepy(metal.material, "Iron"): strepy(metal.units, "cubic meters"); 6 printf( The metal information is : \n%s\n%4.1lf degress longitude\n%4.alf degress" "latitude\n%4e %s\n\n",metal.material, metal.logitude, metal.latitude, metal.quantity, metal.units); printf("Enter water and power : \ncity, year and usage\n"); scanf("%s%d%If%s%d%If",&water.city, &water.year, &water.usage,&power.city,&power.year,&power.usage); 7 printf("\n\nThe water and power are : \n%s\n%d\n%4.0if million liters\n\n%s\n%d\n%4.01lf mega watts\n", water.city, water.year, water.usage,power.city,power.year.power.usage); 2. Develop a complete program for currency conversion rate as defined in Table 1. In main function, your program should prompt the currency conversion selection, and the USD value should be received through user input. Then, the conversion selection and USD value will pass to function name as convert. The convert function is used to convert the currency from USD into other currency according to conversion selection. The conversion value will return to called function. 3. 3.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Structure chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr