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...
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...
bool update(char userInput){ int i = board_height - 1; int j = userInput - 'A'; while(i>=0){...
bool update(char userInput){ int i = board_height - 1; int j = userInput - 'A'; while(i>=0){ if(board[i][j] == ' '){ board[i][j] = next; if(checkRow(i,j,next) || checkColumn(i,j,next) || checkLeftDiagonal(i,j,next) || checkRightDiagonal(i,j,next)){ global_state = next - '0'; } if(next == '1'){ next = '2'; }else{ next = '1'; } break; } i--; } if(i == -1){ return false; } return true; } How can this be turned into int update instead of bool update
Construct a flowchart based on this code and write its equivalent algorithms. #include <stdio.h> int main()...
Construct a flowchart based on this code and write its equivalent algorithms. #include <stdio.h> int main() { int x,y; float result; char ch; //to store operator choice printf("Enter first number: "); scanf("%d",&x); printf("Enter second number: "); scanf("%d",&y); printf("Choose operation to perform (+,-,*,/): "); scanf(" %c",&ch); result=0; switch(ch) { case '+': result=x+y; break; case '-': result=x-y; break; case '*': result=x*y; break; case '/': result=(float)x/(float)y; break; case '%': result=x%y; break; default: printf("Invalid operation.\n"); } printf("Result: %d %c %d = %.2f\n",x,ch,y,result); // Directly...
C CODE PLZ! Need all TO DO sections finished thanks #include <stdio.h> int main(int argc, char...
C CODE PLZ! Need all TO DO sections finished thanks #include <stdio.h> int main(int argc, char **argv) { const int BUF_LEN = 128; char str[BUF_LEN]; int i; char c; int is_binary; int d, n; /* Get the user to enter a string */ printf("Please enter a string made of 0s and 1s, finishing the entry by pressing Enter.\n"); for (i=0; i<BUF_LEN-1; i++) { scanf("%c", &c); if (c == '\n') { break; } str[i] = c; } str[i] = '\0'; /*...
I need to add two trivial functions to the following code. I am having an issue...
I need to add two trivial functions to the following code. I am having an issue with what i may need to change in the current code to meet the requirements. I am already displaying the bank record but now using a function Here are some examples of what i can add to the code 1. Obtain opening (current) balance. 2. Obtain number the number of deposits. 3. Obtain number of withdrawals. 4. Obtain deposit amounts. 5. Obtain withdrawal amounts....
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...
This is my code and can you please tell me why it's not working? By the...
This is my code and can you please tell me why it's not working? By the way, it will work if I reduce 10,000,000 to 1,000,000. #include <iostream> using namespace std; void radixSort(int*a, int n) { int intBitSize = sizeof(int)<<3; int radix = 256; int mask = radix-1; int maskBitLength = 8;    int *result = new int[n](); int *buckets = new int[radix](); int *startIndex = new int[radix]();    int flag = 0; int key = 0; bool hasNeg =...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT