Course Solutions Uncategorized (Solved) : C Program Complete Following Program Declare Enum Agegroup 5 Values Infant Children Teen A Q34363470 . . . .

(Solved) : C Program Complete Following Program Declare Enum Agegroup 5 Values Infant Children Teen A Q34363470 . . . .

 

C program

Complete the following program by:

  1. Declare an enum “agegroup” with 5 values:infant, children, teen, adult and elderly;
  2. Declare a struct called “customer” thatcontains a string field “name“, a integer field”memberId“, and an enum agegroup field”ageGroup“;
  3. Write the CreateCustomerRecord function thatmallocs a new customer record and returns itsreference to the caller.

Be reminded that the upper/lower cases for the names areimportant. The framework of the program is given below. Fill it inso it will run with proper output:

#include <stdio.h>

#include <stdlib.h>

// insert struct/enum declarations

typedef struct customer Customer;

typedef enum agegroup AgeGroup;

// insert the CreateCustomerRecord function

int main()

{

    Customer *c;

    c = CreateCustomerRecord(“JohnChan”,1234,adult);

    printf(“%s %d%dn”,c->name,c->memberId,c->ageGroup);

    return 0;

}

Expert

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post