Question

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)
   {
       printf("subscriber not found\n");
       return;
   }

   int numOfDaysHospitalized, suppliesCost, surgicalFee, otherCharges;
   bool ICU;

   printf("How many days were you haspitalized: ");
   scanf("%d", &numOfDaysHospitalized);

   int ICUFlag;
   do {
       printf("Select A Ward Type\n1-Normal Ward 2-ICU: ");
       scanf("%d", &ICUFlag);
   } while (ICUFlag < 1 || ICUFlag>2);
   if (ICUFlag == 2)
       ICU = true;
   else
       ICU = false;

   printf("Enter Cost of Supplies and Services: ");
   scanf("%d", &suppliesCost);

   printf("Enter Surgical Fees: ");
   scanf("%d", &surgicalFee);

   printf("Enter Other Charges: ");
   scanf("%d", &otherCharges);

   int ICUCharges = 0;
   if (ICU == true)
   {
       if (users[i].plan == 1)
           ICUCharges = numOfDaysHospitalized * 120;
       else if (users[i].plan == 2)
           ICUCharges = numOfDaysHospitalized * 150;
       else
           ICUCharges = numOfDaysHospitalized * 200;
   }
   else
   {
       if (users[i].plan == 1)
           ICUCharges = numOfDaysHospitalized * 250;
       else if (users[i].plan == 2)
           ICUCharges = numOfDaysHospitalized * 400;
       else
           ICUCharges = numOfDaysHospitalized * 700;
   }

   int totalClaimAmount = numOfDaysHospitalized + suppliesCost + surgicalFee + otherCharges + ICUCharges;
  
   if (users[i].annualClaim == true)
   {
       if (users[i].age > 60)
       {
           printf("The subscriber age has exceeded the limit(60 Year), Not Eligible");
           return;
       }
   }
   int j;
   for (j = 0; j < userCount; j++)
   {
       if (claims[j].id == users[i].id)
           break;
   }
  
   int amountToBeBorne = 0;
   if (totalClaimAmount <= claims[j].remaininigAmount)
   {
       claims[j].amountClaimed += totalClaimAmount;
       claims[j].remaininigAmount -= totalClaimAmount;
   }
   else
   {
       amountToBeBorne = totalClaimAmount - claims[j].remaininigAmount;
       claims[j].amountClaimed += (totalClaimAmount - amountToBeBorne);
       claims[j].remaininigAmount = 0;

       printf("\n\nThe amount that can be claimed is less then the claim by subscriber. %d RM should be given by subscriber themselves\n", amountToBeBorne);
   }

   FILE *fp;
   fp = fopen("claims.txt", "w");

   for(int i=0;i<userCount;i++)
       fprintf(fp,"%d,%d,%d,%d\n", claims[i].id, claims[i].claimedYear, claims[i].amountClaimed, claims[i].remaininigAmount);
   fclose(fp);

   printf("Subscriber ID: %d\nSubscriber Name: %s\nSubscriber Claimed Year: %d\nSubscriber amount Claimed: %d\nSubscriber Remaining Claimed: %d\n", claims[j].id, users[i].name, claims[j].claimedYear, claims[j].amountClaimed, claims[j].remaininigAmount);
   system("pause");
}

Homework Answers

Answer #1

You can use CoCodeX it's easily available for Windows machines.

Download that and paste the code to convert the code into the flow chart.

Here are some images of the flowchart of above code:

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
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",...
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...
why's is my csis.txt saving ? #include <stdio.h> FILE*fp; void calculateBMI(void); int main(void) {    fp...
why's is my csis.txt saving ? #include <stdio.h> FILE*fp; void calculateBMI(void); int main(void) {    fp = fopen("csis.txt", "w"); for (int i= 0; i<4; ++i){ calculateBMI(); } fclose(fp); return 0; } void calculateBMI(void){ double weight,height,bmi;    printf("Enetr your weight in pounds:\n\n"); fprintf(fp,"Enter your weight in pounds:\n\n"); scanf("%lf",&weight); printf("Enter height in inches:\n\n"); fprintf(fp,"Enter height in inches:\n\n"); scanf("%lf",&height); bmi=(703*weight)/(height*height);    if (bmi<18.5){ printf("You have a BMI of %.lf, and your weight status is underweight\n",bmi);    fprintf(fp,"You have a BMI of %.lf, and...
C++ Please and thank you. I will upvote Read the following problem, and answer questions. #include<iostream>...
C++ Please and thank you. I will upvote Read the following problem, and answer questions. #include<iostream> using namespace std; void shownumbers(int, int); int main() { int x, y; cout << "Enter first number : "; cin >> x; cout << "Enter second number : "; cin >> y; shownumbers(x, y); return 0; } void shownumbers(int a, int b) { bool flag; for (int i = a + 1; i <= b; i++) { flag = false; for (int j =...
CS4315 Operating Systems Lab 2: Linux Processes This lab assignment contains three questions. To submit this...
CS4315 Operating Systems Lab 2: Linux Processes This lab assignment contains three questions. To submit this lab assignment, please use a Word document to include the screenshots and write your answer. 1. Run the following C program, and submit a screenshot of the result. #include <sys/types.h> #include <stdio.h> #include <unistd.h> int main( ) { pid_t pid; if ( (pid = fork()) == 0 ) { printf (“I am the child, my pid = %d and my parent pid = %d\n”,...
Helllp plz Allow the InsertAt method to add to the front position 0 (zero) also if...
Helllp plz Allow the InsertAt method to add to the front position 0 (zero) also if you try to add to a position greater than the number of nodes you get an error warning. /INSERT.C /*THIS PROGRAM READS A BINARY FILE (MUST ALREADY EXIST AND BE FILLED) */ /*AND PUTS IT INTO A LINKED LIST AND PRINTS THE LIST TO THE SCREEN) */ #include #include #include #include typedef struct ENTRY { char name[81]; }ENTRY; typedef struct LISTREC /* LISTREC is...
Question: I get a Segmentation fault error sometimes when I addElementBack or print. Am I using...
Question: I get a Segmentation fault error sometimes when I addElementBack or print. Am I using pointers correctly and deleting memory properly? #ifndef DYNAMICARRAY_H #define DYNAMICARRAY_H #include <cstdlib> #include <iostream> using namespace std; // Node class class Node { int data; Node* next; Node* prev; public: Node(); Node(int); void SetData(int newData) { data = newData; }; void SetNext(Node* newNext) { next = newNext; }; void SetPrev(Node* newPrev) { prev = newPrev; }; int getData() { return data; }; Node* getNext()...
Please answer the following C question: Read the following files called array-utils5A.c and array-utils5A.h. Build an...
Please answer the following C question: Read the following files called array-utils5A.c and array-utils5A.h. Build an executable with gcc -Wall -DUNIT_TESTS=1 array-utils5A.c The definitions for is_reverse_sorted and all_different are both defective. Rewrite the definitions so that they are correct. The definition for is_alternating is missing. Write a correct definition for that function, and add unit tests for it, using the unit tests for is_reverse_sorted and all_different as models. Please explain the logic errors present in in the definition of is_reverse_sorted...
in C++ Please and thanks Here is a list of 6 numbers. Use the selection sort...
in C++ Please and thanks Here is a list of 6 numbers. Use the selection sort algorithm to sort this list. Fill in this table with each iteration of the loop in the selection sort algorithm. Mark the place from which you are looking for the 'next smallest element'. In this display, the upper numbers are the indices, the lower numbers are in the corresponding positions. Use the several rows provided to show the sequence of steps. 0 1 2...
Using the C programming language implement Heapsort in the manner described in class. Here is some...
Using the C programming language implement Heapsort in the manner described in class. Here is some example code to use as a guideline. Remember, you need only implement the sort algorithm, both the comparison and main functions have been provided. /* * * after splitting this file into the five source files: * * srt.h, main.c, srtbubb.c, srtinsr.c, srtmerg.c * * compile using the command: * * gcc -std=c99 -DRAND -DPRNT -DTYPE=(float | double) -D(BUBB | HEAP | INSR |...