Question

In: Computer Science

Hello i need pesodocde of this code. void accountInfo() { system("cls"); int ch; printf("1-Total Amount Claimed...

Hello i need pesodocde of this code.

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");
}

Solutions

Expert Solution

FUNCTION accountinfo()
    declare ch
    CHOOSE ch 
    1 for Total Amount Claimed by LifeTime Claim Limit subscriber
    2 for  Total number of Annual Claim Limit who have exhausted all their eligible amount
    if ch is equal to 1 then
      SET totalAmountClaimedByLifeTimeSubs to  zero
      for i is less than patientCount
      if claims is equals to patients then
        COMPUTE totalAmountClaimedByLifeTimeSubs
      print totalAmountClaimedByLifeTimeSubs
    else 
      for i is less than patientCount
      COUNT  number of Annual Claim Limit Subcriber who have exhausted all their amount
      print count
END

FUNCTION searchingFunctionalities()
  declare ch
  CHOOSE ch 
  1 for Search by ID
  2 for Search by age
  print "Enter patient ID for which you want Search"
  if ch is equal to 1 then
    if patient_ID is equal to ID then
      print "Details of  patient searched by ID"
  else
      if patient_age is equal to age then
      print "Details of  patient searched by age"
END

Note:: If any queries comment


Related Solutions

Explain the code below in details. void accountInfo() { system("cls"); int ch; printf("1-Total Amount Claimed by...
Explain the code below in details. 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; } }...
I need pesodocode of this code. void claimProcess() { int id; bool found = false; system("cls");...
I need pesodocode of this code. 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...
What is the ouput of the following code? void loop(int num) { for(int i = 1;...
What is the ouput of the following code? void loop(int num) { for(int i = 1; i < num; ++i) { for(int j = 0; j < 5; ++j) { cout << j; } } } int main() { loop(3); return 0; }
#include <stdio.h> void printDistinct(int arr[], int c) { int i, j; printf("\nArray:\n"); // Picking all elements...
#include <stdio.h> void printDistinct(int arr[], int c) { int i, j; printf("\nArray:\n"); // Picking all elements one by one for (i = 0; i < c; i++) { // Checking if the picked element is already printed for (j = 0; j <= i; j++) { // If current element is already there in the array, break from j loop if (arr[i] == arr[j]) { break; } } // If it is not printed earlier and is within 10-100, then...
Consider the following code: void swap(int arr[], int i, int j) {        int temp = arr[i];...
Consider the following code: void swap(int arr[], int i, int j) {        int temp = arr[i];        arr[i] = arr[j];        arr[j] = temp; } void function(int arr[], int length) {        for (int i = 0; i<length / 2; i++)               swap(arr, i, (length / 2 + i) % length); } If the input to the function was int arr[] = { 6, 1, 8, 2, 5, 4, 3, 7 }; function(arr,8); What values would be stored in the array after calling the...
What’s the output of following code fragment: #include<stdio.h> #include<signal.h> void response (int sig_no) { printf("25"); }...
What’s the output of following code fragment: #include<stdio.h> #include<signal.h> void response (int sig_no) { printf("25"); } void response2 (int sig_no) { printf("43"); }     int main() {      int id = getpid();      signal(SIGUSR1, response); signal(SIGKILL, response2); for(int i=0; i<4; i++) { sleep(1); if (i % 3 == 0) { kill(id, SIGUSR1); } else { kill(id, SIGKILL); } } return 0; }
Hello sir can you explain me this code in details. void claimProcess() { int id; bool...
Hello sir can you explain me this code in details. 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: ");...
Please explain this code line by line void printperm(int *A,int n,int rem,int j) {    if(n==1)...
Please explain this code line by line void printperm(int *A,int n,int rem,int j) {    if(n==1)       {        for(int k=0;k<j;k++)        cout<<A[k]<<" + ";        cout<<rem<<"\n";        return;       }     for(int i=0;i<=rem;i++)    {          if(i<=rem)          A[j]=i;          printperm(A,n-1,rem-i,j+1);    } }
#include <stdio.h> #include <ctype.h> int main(void) { int ch; unsigned long int charcount=0, wordcount=0, linecount=0; while((ch=getchar())!=EOF){...
#include <stdio.h> #include <ctype.h> int main(void) { int ch; unsigned long int charcount=0, wordcount=0, linecount=0; while((ch=getchar())!=EOF){ if(ch==' ' || ch=='\n' || ch=='\t' || ch=='\0' || ch=='\r') { wordcount++; } if(ch=='\n' || ch=='\0') { linecount++; } charcount++; } printf("%lu %lu %lu\n", charcount, wordcount, linecount); getchar(); return 0; } When my code reads a blank line, it increment my wordcount by one. How can I fix this problem? Could you help me with this problem?
C++ Hello .I need to convert this code into template and then test the template with...
C++ Hello .I need to convert this code into template and then test the template with dynamic array of strings also if you can help me move the function out of the class that would be great.also There is a bug where the memory was being freed without using new operator. I cant seem to find it thanks in advance #include using namespace std; class DynamicStringArray {    private:        string *dynamicArray;        int size;    public:   ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT