subject

Answer the following true/false questions using the code that follows. You must correctly state WHY your answer is true or false in order to receive credit.
# include
# include
# include
#define SIZE 4
typedef struct dessert{
char size;
float price;
charflavor[20]:
int available;
}dessert;
void give info(dessert *des, int size, char filename)
{
FILE *fp=fopen(filename,"r");
char *token;
char line[40];
int i
for(i 0:i {
fgets(line, 40, fp);
token-strtok(line,"":
des[i].size=token[0];
token strtok(NULL,".");
des[i. price-atof token);
token strtok(NULL,",");
strcpy(des[i].flavor, token):
token strtok(NULL,"n)
desi available-atoi(token);
}
fclose(fp):
}
void print report(dessert "d, int size)
{
int i
printf(nCURRENT INVENTORY: n");
for(i 0 i {
printf(" Info for Item %d \n", (i+ 1));
printf("Size: %<\n", (*d)size);
printf(" Price: 962f\n", ("d).price);
printf(" Flavor: %s\n", (*d) flavor);
printf("Ava ili blity: %d\n\n", ("d).available);
d ++:
}
}
int main (int argc, char "argv)
{
int num-atoi(argv1);
dessert "des (dessert)malloc(sizeof dessert) num):
if(des-=NULL)
{
printf ("Error getting you some memory! Bye. In");
}
else
{
give jinfo(des, num, argv[21):
print report(des, num):
}
free(des):
}
True / False:
1) The function printf is defined in this program.
2) stdio. h is the function that allows us to output to screen.
3) This code includes one header and two preprocessor directives.
4) argc is a function.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:50, brennarfa
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
image
Computers and Technology, 24.06.2019 08:30, 5theth
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
image
Computers and Technology, 24.06.2019 15:30, S917564
The idea that, for each pair of devices v and w, there’s a strict dichotomy between being “in range” or “out of range” is a simplified abstraction. more accurately, there’s a power decay function f (·) that specifies, for a pair of devices at distance δ, the signal strength f(δ) that they’ll be able to achieve on their wireless connection. (we’ll assume that f (δ) decreases with increasing δ.) we might want to build this into our notion of back-up sets as follows: among the k devices in the back-up set of v, there should be at least one that can be reached with very high signal strength, at least one other that can be reached with moderately high signal strength, and so forth. more concretely, we have values p1 ≥ p2 ≥ . . ≥ pk, so that if the back-up set for v consists of devices at distances d1≤d2≤≤dk, thenweshouldhavef(dj)≥pj foreachj. give an algorithm that determines whether it is possible to choose a back-up set for each device subject to this more detailed condition, still requiring that no device should appear in the back-up set of more than b other devices. again, the algorithm should output the back-up sets themselves, provided they can be found.\
Answers: 2
image
Computers and Technology, 24.06.2019 17:50, jones03riley
You work in the accounting department and have been using a network drive to post excel workbook files to your file server as you complete them. when you attempt to save a workbook file to the drive, you see the error message: “you do not have access to the folder ‘j: \’. see your administrator for access to this folder.” what should you do first
Answers: 2
You know the right answer?
Answer the following true/false questions using the code that follows. You must correctly state WHY...

Questions in other subjects:

Konu
History, 15.10.2019 15:20