Question

In: Computer Science

Hello sir can you plz change my below code like change names , function name and...

Hello sir can you plz change my below code like change names , function name and add comments so it wont look same but run same. change as much as you can thank you.

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#include<time.h>
struct patient {
int id;
int age;
bool annualClaim;
int plan;
char name[30];
char contactNum[15];
char address[50];
};
#define MAX_LENGTH 500
struct patient patients[100];
int patientCount = 0;
struct claim {
int id;
int claimedYear;
int amountClaimed;
int remaininigAmount;
};
struct claim claims[100];
void subscribe()
{
system("cls");
patients[patientCount].id = patientCount + 1;
printf("Enter age: ");
scanf("%d", & patients[patientCount].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("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20d|%-20d|%-20d|\n", "Annual Claim Limit", 120000, 150000, 200000);
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20d|%-20d|%-20d|\n", "Lifetime Claim Limit", 600000, 750000, 1000000);
printf("-----------------------------------------------------------------------------------------------\n");
printf("\n\n%-25sAge Group and Health Insurence Plan\n\n", " ");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-25s%-30s\n", "Types of Claim", " ", "Eligibility Amount");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", " ", "Plan 120(RM)", "Plan 150(RM)", "Plan 200(RM)");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Room Charges", "120/day", "150/day", "200/day");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Intensive Care Unit", "250/day", "400/day", "700/day");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Hospital Supplies and Services", " ", " ", " ");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-60s|\n", "Surgical Fees", "As charged Sbject to approval by ZeeMediLife");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Other Fees", " ", " ", " ");
printf("-----------------------------------------------------------------------------------------------\n\n");
int ch;
do {
printf("Select a Claim Limit Type\n1-Annual Claim Limit 2-Lifetime Claim Limit: ");
scanf("%d", & ch);
} while (ch < 1 || ch > 2);
if (ch == 1)
patients[patientCount].annualClaim = true;
else
patients[patientCount].annualClaim = false;
do {
printf("Select a plan\n1-Plan120 2-Plan150 3-Plan200: ");
scanf("%d", & ch);
} while (ch < 1 || ch > 3);
patients[patientCount].plan = ch;
printf("Enter Name: ");
scanf("%s", & patients[patientCount].name);
printf("Contact Number: ");
scanf("%s", & patients[patientCount].contactNum);
printf("Enter Address: ");
scanf("%s", & patients[patientCount].address);
FILE * fp;
fp = fopen("patients.txt", "a");
fprintf(fp, "%d,%s,%d,%d,%d,%s,%s\n", patients[patientCount].id, patients[patientCount].name, patients[patientCount].age, patients[patientCount].annualClaim, patients[patientCount].plan, patients[patientCount].contactNum, patients[patientCount].address);
fclose(fp);
time_t s;
struct tm * currentTime;
s = time(NULL);
currentTime = localtime( & s);
claims[patientCount].id = patients[patientCount].id;
claims[patientCount].amountClaimed = 0;
claims[patientCount].claimedYear = currentTime -> tm_hour + 1900;
if (patients[patientCount].annualClaim == true)
{
if (patients[patientCount].plan == 1)
claims[patientCount].remaininigAmount = 120000;
else if (patients[patientCount].plan == 2)
claims[patientCount].remaininigAmount = 150000;
else
claims[patientCount].remaininigAmount = 200000;
} else
{
if (patients[patientCount].plan == 1)
claims[patientCount].remaininigAmount = 600000;
else if (patients[patientCount].plan == 2)
claims[patientCount].remaininigAmount = 750000;
else
claims[patientCount].remaininigAmount = 1000000;
}
patientCount++;
fp = fopen("claims.txt", "a");
if (fp == NULL)
printf("File Dont exist");
fprintf(fp, "%d,%d,%d,%d\n", claims[patientCount].id, claims[patientCount].claimedYear, claims[patientCount].amountClaimed, claims[patientCount].remaininigAmount);
fclose(fp);
system("pause");
}
void claimProcess()
{
int id;
bool found = false;
system("cls");
printf("Enter patient ID for which you want to claim insurrence: ");
scanf("%d", & id);
int i;
for (i = 0; i < patientCount; i++)
{
if (patients[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 (patients[i].plan == 1)
ICUCharges = numOfDaysHospitalized * 120;
else if (patients[i].plan == 2)
ICUCharges = numOfDaysHospitalized * 150;
else
ICUCharges = numOfDaysHospitalized * 200;
} else
{
if (patients[i].plan == 1)
ICUCharges = numOfDaysHospitalized * 250;
else if (patients[i].plan == 2)
ICUCharges = numOfDaysHospitalized * 400;
else
ICUCharges = numOfDaysHospitalized * 700;
}
int totalClaimAmount = numOfDaysHospitalized + suppliesCost + surgicalFee + otherCharges + ICUCharges;
if (patients[i].annualClaim == true)
{
if (patients[i].age > 60)
{
printf("The subscriber age has exceeded the limit(60 Year), Not Eligible");
return;
}
}
int j;
for (j = 0; j < patientCount; j++)
{
if (claims[j].id == patients[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 < patientCount; 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, patients[i].name, claims[j].claimedYear, claims[j].amountClaimed, claims[j].remaininigAmount);
system("pause");
}
void accountInfo()
{
system("cls");
int ch;
printf("1-Total Amount Claimed by LifeTime Claim Limit subscriber\n");
printf("2-Total number of Annual Claim Limit who have exhausted all their eligible amount\n");
scanf("%d", & ch);
if (ch == 1)
{
int totalAmountClaimedByLifeTimeSubs = 0;
for (int i = 0; i < patientCount; i++)
{
if (patients[i].annualClaim == false)
{
for (int j = 0; j < patientCount; j++)
{
if (claims[j].id == patients[i].id)
{
totalAmountClaimedByLifeTimeSubs += claims[j].amountClaimed;
}
}
}
}
printf("\nTotal amount Claimed By LifeTime Subscribers is: %d\n", totalAmountClaimedByLifeTimeSubs);
} else
{
int count = 0;
for (int i = 0; i < patientCount; i++)
{
if (claims[i].remaininigAmount <= 0 && patients[i].annualClaim == true)
count++;
}
printf("Total number of Annual Claim Limit Subcriber who have exhausted all their amount are: %d\n", count);
}
system("pause");
}
void searchingFunctionalities()
{
system("cls");
int ch;
printf("1-Search by ID\n2-Search by age\n");
scanf("%d", & ch);
if (ch == 1)
{
int id;
printf("Enter patient ID for which you want Search: ");
scanf("%d", & id);
int i;
for (i = 0; i < patientCount; i++)
{
if (patients[i].id == id)
{
printf("\nSubscriber Name: %s\nSubscriber Age: %d\nSubscriber Contact: %s\nSubscriber Address: %s\n", patients[i].name, patients[i].age, patients[i].contactNum, patients[i].address);
break;
}
}
printf("Subscriber Not Found");
} else
{
int age;
printf("Enter age for which you want Search: ");
scanf("%d", & age);
for (int i = 0; i < patientCount; i++)
{
if (patients[i].age == age)
{
printf("\nSubscriber Name: %s\nSubscriber ID: %d\nSubscriber Contact: %s\nSubscriber Address: %s\n", patients[i].name, patients[i].id, patients[i].contactNum, patients[i].address);
}
}
}
system("pause");
}
void loadData()
{
char line[MAX_LENGTH];
const char * delimiter = ",\n";
FILE * fp;
fp = fopen("patients.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;
patients[patientCount].id = atoi(strtok(line, delimiter));
strcpy(patients[patientCount].name, strtok(NULL, delimiter));
patients[patientCount].age = atoi(strtok(NULL, delimiter));
patients[patientCount].annualClaim = strtok(NULL, delimiter);
patients[patientCount].plan = atoi(strtok(NULL, delimiter));
strcpy(patients[patientCount].contactNum, strtok(NULL, delimiter));
strcpy(patients[patientCount].address, strtok(NULL, delimiter));
strcpy(line, "\0");
patientCount++;
}
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 ch;
do {
system("cls");
               printf("Select one of the below option to continue\n");
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", & ch);
} while (ch > 5 || ch < 1);
return ch;
}
int main()
{
int ch;
loadData();
do {
ch = menu();
if (ch == 1)
subscribe();
else if (ch == 2)
claimProcess();
else if (ch == 3)
accountInfo();
else if (ch == 4)
searchingFunctionalities();
else
break;
} while (ch != 5);
system("pause");
return 0;
}

Solutions

Expert Solution

Please check this updated version of your code:

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#include<time.h>
struct patient { //Composite data type declaration
int id; // grouped list of varibles in a single block
int age;
bool annual_Claim;
int plan;
char name[30];
char contactNumber[15];
char address[50];
};
#define MAX_LENGTH 500
struct patient patients[100];   
int patientCount = 0;
struct detail_of_claim {
int id;
int claimed_Year;
int totalAmountClaimed;
int remaininigAmt;
};
struct detail_of_claim claims[100];
void subscriber_Detail() // the entire detail of subscriber
{
system("cls");
patients[patientCount].id = patientCount + 1;
printf("Enter age: ");
scanf("%d", & patients[patientCount].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("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20d|%-20d|%-20d|\n", "Annual Claim Limit", 120000, 150000, 200000);
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20d|%-20d|%-20d|\n", "Lifetime Claim Limit", 600000, 750000, 1000000);
printf("-----------------------------------------------------------------------------------------------\n");
printf("\n\n%-25sAge Group and Health Insurence Plan\n\n", " ");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-25s%-30s\n", "Types of Claim", " ", "Eligibility Amount");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", " ", "Plan 120(RM)", "Plan 150(RM)", "Plan 200(RM)");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Room Charges", "120/day", "150/day", "200/day");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Intensive Care Unit", "250/day", "400/day", "700/day");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Hospital Supplies and Services", " ", " ", " ");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-60s|\n", "Surgical Fees", "As charged Sbject to approval by ZeeMediLife");
printf("-----------------------------------------------------------------------------------------------\n");
printf("|%-30s|%-20s|%-20s|%-20s|\n", "Other Fees", " ", " ", " ");
printf("-----------------------------------------------------------------------------------------------\n\n");
int ch;
do {
printf("Select a Claim Limit Type\n1-Annual Claim Limit 2-Lifetime Claim Limit: ");
scanf("%d", & ch);
} while (ch < 1 || ch > 2);
if (ch == 1)
patients[patientCount].annual_Claim = true;
else
patients[patientCount].annual_Claim = false;
do {
printf("Select a plan\n1-Plan120 2-Plan150 3-Plan200: ");
scanf("%d", & ch);
} while (ch < 1 || ch > 3);
patients[patientCount].plan = ch;
printf("Enter your Name: ");
scanf("%s", & patients[patientCount].name);
printf("Enter Contact Number: ");
scanf("%s", & patients[patientCount].contactNumber);
printf("Enter Address: ");
scanf("%s", & patients[patientCount].address);
FILE * fp;
fp = fopen("patients.txt", "a");
fprintf(fp, "%d,%s,%d,%d,%d,%s,%s\n", patients[patientCount].id, patients[patientCount].name, patients[patientCount].age, patients[patientCount].annualClaim, patients[patientCount].plan, patients[patientCount].contactNumber, patients[patientCount].address);
fclose(fp);
time_t s;
struct tm * currentTime;
s = time(NULL);
currentTime = localtime( & s);
claims[patientCount].id = patients[patientCount].id;
claims[patientCount].totalAmountClaimed = 0;
claims[patientCount].claimed_Year = currentTime -> tm_hour + 1900;
if (patients[patientCount].annualClaim == true)
{
if (patients[patientCount].plan == 1)
claims[patientCount].remaininigAmt = 120000;
else if (patients[patientCount].plan == 2)
claims[patientCount].remaininigAmt = 150000;
else
claims[patientCount].remaininigAmt = 200000;
} else
{
if (patients[patientCount].plan == 1)
claims[patientCount].remaininigAmt = 600000;
else if (patients[patientCount].plan == 2)
claims[patientCount].remaininigAmt = 750000;
else
claims[patientCount].remaininigAmt = 1000000;
}
patientCount++;
fp = fopen("claims.txt", "a");
if (fp == NULL)
printf("File Dont exist");
fprintf(fp, "%d,%d,%d,%d\n", claims[patientCount].id, claims[patientCount].claimed_Year, claims[patientCount].totalAmountClaimed, claims[patientCount].remaininigAmt);
fclose(fp);
system("pause");
}
void Processing_of_claim() //processing of the total amount of the claim
{
int id;
bool found = false;
system("cls");
printf("Enter patient ID for which you want to claim insurance: ");
scanf("%d", & id);
int i;
for (i = 0; i < patientCount; i++)
{
if (patients[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-General Ward 2-ICU: ");
scanf("%d", & ICUFlag);
} while (ICUFlag < 1 || ICUFlag > 2);
if (ICUFlag == 2)
ICU = true;
else
ICU = false;
printf("Enter The Total 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 (patients[i].plan == 1)
ICUCharges = numOfDaysHospitalized * 120;
else if (patients[i].plan == 2)
ICUCharges = numOfDaysHospitalized * 150;
else
ICUCharges = numOfDaysHospitalized * 200;
} else
{
if (patients[i].plan == 1)
ICUCharges = numOfDaysHospitalized * 250;
else if (patients[i].plan == 2)
ICUCharges = numOfDaysHospitalized * 400;
else
ICUCharges = numOfDaysHospitalized * 700;
}
int totalClaimAmount = numOfDaysHospitalized + suppliesCost + surgicalFee + otherCharges + ICUCharges;
if (patients[i].annualClaim == true)
{
if (patients[i].age > 60)
{
printf("The subscriber age has exceeded the limit(60 Year), Not Eligible!");
return;
}
}
int j;
for (j = 0; j < patientCount; j++)
{
if (claims[j].id == patients[i].id)
break;
}
int amountToBeBorne = 0;
if (totalClaimAmount <= claims[j].remaininigAmt)
{
claims[j].amountClaimed += totalClaimAmount;
claims[j].remaininigAmt -= totalClaimAmount;
} else
{
amountToBeBorne = totalClaimAmount - claims[j].remaininigAmt;
claims[j].amountClaimed += (totalClaimAmount - amountToBeBorne);
claims[j].remaininigAmt = 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 < patientCount; i++)
fprintf(fp, "%d,%d,%d,%d\n", claims[i].id, claims[i].claimed_Year, claims[i].amountClaimed, claims[i].remaininigAmt);
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, patients[i].name, claims[j].claimedYear, claims[j].amountClaimed, claims[j].remaininigAmt);
system("pause");
}
void account_Detail() //showing account detail
{
system("cls");
int ch;
printf("1-Total Amount Claimed by the LifeTime Claim Limit subscriber\n");
printf("2-Total number of Annual Claim Limit who have exhausted all their eligible amount\n");
scanf("%d", & ch);
if (ch == 1)
{
int AmountClaimedByLifeTimeSubs = 0;
for (int i = 0; i < patientCount; i++)
{
if (patients[i].annualClaim == false)
{
for (int j = 0; j < patientCount; j++)
{
if (claims[j].id == patients[i].id)
{
AmountClaimedByLifeTimeSubs += claims[j].amountClaimed;
}
}
}
}
printf("\nTotal amount Claimed By the LifeTime Subscribers is: %d\n", AmountClaimedByLifeTimeSubs);
} else
{
int count = 0;
for (int i = 0; i < patientCount; i++)
{
if (claims[i].remaininigAmt <= 0 && patients[i].annualClaim == true)
count++;
}
printf("Total number of Annual Claim Limit Subcriber who have exhausted all their amount are: %d\n", count);
}
system("pause");
}
void searching_Patient() //searching patient by using their ID or age
{
system("cls");
int ch;
printf("1-Search by ID\n2-Search by age\n");
scanf("%d", & ch);
if (ch == 1)
{
int id;
printf("Enter patient ID for which you want Search: ");
scanf("%d", & id);
int i;
for (i = 0; i < patientCount; i++)
{
if (patients[i].id == id)
{
printf("\nSubscriber Name: %s\nSubscriber Age: %d\nSubscriber Contact: %s\nSubscriber Address: %s\n", patients[i].name, patients[i].age, patients[i].contactNum, patients[i].address);
break;
}
}
printf("Subscriber Not Found");
} else
{
int age;
printf("Enter age for which you want Search: ");
scanf("%d", & age);
for (int i = 0; i < patientCount; i++)
{
if (patients[i].age == age)
{
printf("\nSubscriber Name: %s\nSubscriber ID: %d\nSubscriber Contact: %s\nSubscriber Address: %s\n", patients[i].name, patients[i].id, patients[i].contactNumber, patients[i].address);
}
}
}
system("pause");
}
void load_Data()
{
char line[MAX_LENGTH];
const char * delimiter = ",\n";
FILE * fp;
fp = fopen("patients.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;
patients[patientCount].id = atoi(strtok(line, delimiter));
strcpy(patients[patientCount].name, strtok(NULL, delimiter));
patients[patientCount].age = atoi(strtok(NULL, delimiter));
patients[patientCount].annualClaim = strtok(NULL, delimiter);
patients[patientCount].plan = atoi(strtok(NULL, delimiter));
strcpy(patients[patientCount].contactNum, strtok(NULL, delimiter));
strcpy(patients[patientCount].address, strtok(NULL, delimiter));
strcpy(line, "\0");
patientCount++;
}
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].remaininigAmt = atoi(strtok(NULL, delimiter));
strcpy(line, "\0");
claimCount++;
}
fclose(fp);
}
int menu() //showing the menu detail for further processing
{   
int ch;
do {
system("cls");
printf("Select one of the below option to continue\n");
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", & ch);
} while (ch > 5 || ch < 1);
return ch;
}
int main()
{
int ch;
load_Data();
do {
ch = menu();
if (ch == 1)
subscriber_Detail(); // entire detail of subcriber
else if (ch == 2)
Processing_of_claim(); // processing of claim
else if (ch == 3)
account_Detail();
else if (ch == 4)
searching_Patient(); //searching patient by using age or Id
else
break;
} while (ch != 5);
system("pause");
return 0;
}


Related Solutions

This code works fine. In java, can you: change the variable and method names to make...
This code works fine. In java, can you: change the variable and method names to make logical sense add method header comments to describe what the method does and what the params/returns are add a class header comment to describe what the code does import java.util.Arrays; import java.util.Scanner; public class MethodLibrary { public static void main(String args[]) { System.out.println("MethodLibrary"); System.out.println("Example use of methods"); int[] smallNums1 = {2, 1, 7, 4, 3}; display("display:", smallNums1); char [] characters = {'a','b','c','d','e','f'}; first( characters,...
To my friendly student tax preparer: Hello, my name is Shady Slim. I understand you are...
To my friendly student tax preparer: Hello, my name is Shady Slim. I understand you are going to help me figure out my gross income for the year…whatever that means. It’s been a busy year and I’m a busy man, so let me give you the lowdown on my life and you can do your thing. I was unemployed at the beginning of the year and got $3,500 in unemployment compensation. I later got a job as a manager for...
Hello my name is Pete. I posted my previous question in error by forgetting to mention...
Hello my name is Pete. I posted my previous question in error by forgetting to mention that I am located in New York State and am required to go by those rules and regulations. Erica Swanson (SSN 376-38-4930), age 46, is a single parent with three children: Her biological son, Sean Swanson (age 19) is a part-time college student who works fulltime as a landscaper Her biological daughter, Brooklyn Swanson (age 14) Her adopted daughter, Sydney Swanson (age 12) Although...
Below is my code in C#, When I run it, the output shows System.32[], Can you...
Below is my code in C#, When I run it, the output shows System.32[], Can you please check and let me know what is the problem in the code. class Program { static void Main(string[] args) { int number=12; Console.WriteLine(FizzArray(number)); } public static int[] FizzArray(int number) { int[] array = new int[number]; for (int i = 1; i < number; i++) array[i] = i; return array; }
Python I want to name my hero and my alien in my code how do I...
Python I want to name my hero and my alien in my code how do I do that: Keep in mind I don't want to change my code except to give the hero and alien a name import random class Hero:     def __init__(self,ammo,health):         self.ammo=ammo         self.health=health     def blast(self):         print("The Hero blasts an Alien!")         if self.ammo>0:             self.ammo-=1             return True         else:             print("Oh no! Hero is out of ammo.")             return False     def...
Write a java code snippet to prompt the user for the number of names they’d like...
Write a java code snippet to prompt the user for the number of names they’d like to enter. Create a new array of the size chosen by the user and prompt the user for each of the names. Output the list of names in reverse order.
Plz convert this C++ code into JAVA code thanks #include<iostream> using namespace std; //function for calculating...
Plz convert this C++ code into JAVA code thanks #include<iostream> using namespace std; //function for calculating the average sightings from the Total Sightings array float calcAverage(float totalSightings[],int n) {    int i;    float sum=0.0;    for(i=0;i<n;i++)    sum=sum+totalSightings[i];    return sum/n; } int main() {    // n is no. of bird watchers    //flag , flag2 and flag3 are for validating using while loops    int n,i,flag,flag2,flag3;       //ch also helps in validating    char ch;   ...
How can I improve my code below to meet the requirements of this assignment with syntax...
How can I improve my code below to meet the requirements of this assignment with syntax add to my code to complete the assignment below: #include <iostream> #include <vector> using namespace std; class Inventory { private: int itemNumber; int quantity; double cost; double totalCost; public: Inventory() { itemNumber = 0; quantity = 0; cost = 0; totalCost = 0; } Inventory(int n, int q, double c) { itemNumber = n; quantity = q; cost = c; setTotalCost(); } void setItemNumber(int...
Below is my source code for file merging. when i run the code my merged file...
Below is my source code for file merging. when i run the code my merged file is blank and it never shows merging complete prompt. i dont see any errors or why my code would be causing this. i saved both files with male names and female names in the same location my source code is in as a rtf #include #include #include using namespace std; int main() { ifstream inFile1; ifstream inFile2; ofstream outFile1; int mClientNumber, fClientNumber; string mClientName;...
PLZ RE-PHRASE the Following DATA (This data is taken from different papers you can change it...
PLZ RE-PHRASE the Following DATA (This data is taken from different papers you can change it at some extent ):- Distributed generation terminology is utilized showing a scale electricity generation that is small. Just what exactly now could be scale electricity generation that is tiny? Currently, there is no contract as to in what way generation that is distributed undoubtedly be defined. As according to study of CIRED [1], there isn't any contract through the fundamental notion of this term...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT