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");
}
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:
Get Answers For Free
Most questions answered within 1 hours.