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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
You know the right answer?
Answer the following true/false questions using the code that follows. You must correctly state WHY...
Questions
question
Mathematics, 07.12.2020 18:00
question
Arts, 07.12.2020 18:00
question
Mathematics, 07.12.2020 18:00
question
History, 07.12.2020 18:00
question
Mathematics, 07.12.2020 18:00
question
Social Studies, 07.12.2020 18:00
question
Mathematics, 07.12.2020 18:00
Questions on the website: 13722367