Question

Design flow chart of this code and make sure it is not handwritten it must on...

Design flow chart of this code and make sure it is not handwritten it must on some software.

struct user {
   int id;
   int age;
   bool annualClaim;
   int plan;
   char name[30];
   char contactNum[15];
   char address[50];
};
#define MAX_LENGTH 500
struct user users[100];
int userCount = 0;

struct claim {
   int id;
   int claimedYear;
   int amountClaimed;
   int remaininigAmount;
};
struct claim claims[100];

void loadData()
{
   char line[MAX_LENGTH];
   const char *delimiter = ",\n";
   FILE *fp;
   fp = fopen("users.txt", "r");
   char c;

   if (fp == NULL)
   {
       printf("file not found");
       return;
   }

   while (fp != NULL)
   {
       if (fgets(line, MAX_LENGTH - 1, fp) == NULL)
           break;
       if (line[1] == '\0')
           break;
       users[userCount].id = atoi(strtok(line, delimiter));
       strcpy(users[userCount].name,strtok(NULL, delimiter));
       users[userCount].age = atoi(strtok(NULL, delimiter));
       users[userCount].annualClaim = strtok(NULL, delimiter);
       users[userCount].plan = atoi(strtok(NULL, delimiter));
       strcpy(users[userCount].contactNum, strtok(NULL, delimiter));
       strcpy(users[userCount].address, strtok(NULL, delimiter));
       strcpy(line, "\0");
       userCount++;
   }
   fclose(fp);

   fp = fopen("claims.txt", "r");
   int claimCount = 0;
   while (fp != NULL)
   {
       if (fgets(line, MAX_LENGTH - 1, fp) == NULL)
           break;
       if (line == "\n")
           break;
       claims[claimCount].id = atoi(strtok(line, delimiter));
       claims[claimCount].claimedYear = atoi(strtok(NULL, delimiter));
       claims[claimCount].amountClaimed = atoi(strtok(NULL, delimiter));
       claims[claimCount].remaininigAmount = atoi(strtok(NULL, delimiter));
       strcpy(line, "\0");
       claimCount++;
   }
   fclose(fp);
}

int menu()
{
   int choice;
   do {
       system("cls");
       printf("1-Insurence Plan Subscription\n");
       printf("2-Claim Processing\n");
       printf("3-Accounts Information\n");
       printf("4-Searching Functionalities\n");
       printf("5-Exit\n");
       scanf("%d", &choice);
   } while (choice > 5 || choice < 1);
   return choice;
}

Homework Answers

Answer #1

The flowchart ,which shows the execution flow of the program.

The flowchart of the program is as follows,

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Design flow chart on software not handwritten. void claimProcess() {    int id;    bool found...
Design flow chart on software not handwritten. void claimProcess() {    int id;    bool found = false;    system("cls");       printf("Enter user ID for which you want to claim insurrence: ");    scanf("%d", &id);    int i;    for (i = 0; i < userCount; i++)    {        if (users[i].id == id)        {            found = true;            break;        }    }    if (found == false)   ...
Explain this code function by function in detail int menu() {   int choice;   do {     system("cls");...
Explain this code function by function in detail int menu() {   int choice;   do {     system("cls");     printf("1-Insurence Plan Subscription\n");     printf("2-Claim Processing\n");     printf("3-Accounts Information\n");     printf("4-Searching Functionalities\n");     printf("5-Exit\n");     scanf("%d", &choice);   } while (choice > 5 || choice < 1);   return choice; void subscribe() system("cls");   victims[userCount].id = userCount + 1;   printf("Enter age: ");   scanf("%d", &victims[userCount].age);   printf("\n\n%-25sHealth Insurence Plan\n\n", " ");   printf("-----------------------------------------------------------------------------------------------\n");   printf("|%-30s|%-20s|%-20s|%-20s|\n", " ", "Plan 120(RM)", "Plan 150(RM)", "Plan 200(RM)");   printf("-----------------------------------------------------------------------------------------------\n");   printf("|%-30s|%-20d|%-20d|%-20d|\n", "Monthly Premium", 120, 150, 200);   printf("|%-30s|%-20d|%-20d|%-20d|\n", "Annual Claim Limit", 120000,150000,200000);   printf("|%-30s|%-20d|%-20d|%-20d|\n",...
create case 4 #include <stdio.h> int main(void) { int counter; int choice; FILE *fp; char item[100];...
create case 4 #include <stdio.h> int main(void) { int counter; int choice; FILE *fp; char item[100]; while(1) { printf("Welcome to my shopping list\n\n"); printf("Main Menu:\n"); printf("1. Add to list\n"); printf("2. Print List\n"); printf("3. Delete List\n"); printf("4. Remove an item from the List\n"); printf("5. Exit\n\n"); scanf("%i", &choice); switch(choice) { case 1: //add to list //get the input from the user printf("Enter item: "); scanf("%s", item); //open the file fp = fopen("list.txt","a"); //write to the file fprintf(fp, "\n%s", item); //close the file...
The code is in C programming language pls convert it into python. Thanks. Program --> #include...
The code is in C programming language pls convert it into python. Thanks. Program --> #include <stdio.h> #include <stdlib.h> void main() { //declare variables FILE *fileptr; char filename[15]; char charRead; char filedata[200],searchString[50]; int i=0,j=0,countNoOfWord=0,count=0; //enter the filename to be opened printf("Enter the filename to be opened \n"); scanf("%s", filename); /* open the file for reading */ fileptr = fopen(filename, "r"); //check file exit if (fileptr == NULL) { printf("Cannot open file \n"); exit(0); } charRead = fgetc(fileptr); //read the string...
LANGUAGE C The codes below reads another .c or .txt file. Then, it will read the...
LANGUAGE C The codes below reads another .c or .txt file. Then, it will read the contents of every line and store the contents into a string array. Example: .c file that is to be read: #include <stdio.h> int main(){    printf("Hello World");    return ; } _______________(END OF THE FILE)_______________ Therefore, the code will read the contents above and store the contents in every line into an array, such that.... array[0] = "#include <stdio.h>\n" array[1] = "\n" array[2] ="int...
"C language" Take this code and make the minor modification necessary to create a circular linked...
"C language" Take this code and make the minor modification necessary to create a circular linked list (Hint: Store a pointer to the first node in the next pointer of the last node.) Demonstrate that this is working by traversing the list until the first pointer is encountered 3 times. Next redefine the node structure to include a back pointer. This will enable your program to move from front to back and then from back to front. It is not...
For the following code in C, I want a function that can find "america" from the...
For the following code in C, I want a function that can find "america" from the char array, and print "america is on the list" else "america is not on the list" (Is case sensitive). I also want a function to free the memory at the end of the program. #include <stdio.h> #include <stdlib.h> struct Node { void *data; struct Node *next; }; struct List { struct Node *head; }; static inline void initialize(struct List *list) { list->head = 0;...
Can someone please edit my code so that it satisfies the assignments' requirements? I pasted the...
Can someone please edit my code so that it satisfies the assignments' requirements? I pasted the codes below. Requirement: Goals for This Project:  Using class to model Abstract Data Type  OOP-Data Encapsulation You are asked to write an app to keep track of a relatively small music library. The app should load song information from a data file once the app is started. It should allow user to view, add, remove, and search for songs. The app should...
It is about C++linked list code. my assignment is making 1 function, in below circumstance,(some functions...
It is about C++linked list code. my assignment is making 1 function, in below circumstance,(some functions are suggested for easier procedure of making function.) void search_node(struct linked_list* list, int find_node_ value) (The function to make) This function finds the node from the list that value is same with find_node_value and count the order of the node. This function should print message “The order of (node_value) is (order).” and error message “Function search_node : There is no such node to search.”....
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's...
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's algorithm to ensure mutual exclusion in the respective critical sections of the two processes, and thereby eliminate the race condition. In order to implement Peterson's Algorithm, the two processes should share a boolean array calledflagwith two components and an integer variable called turn, all initialized suitably. We will create and access these shared variables using UNIX system calls relating to shared memory – shmget,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT