As a part of the Healthcare Act, the process for receiving Medicaid services for
ID: 3905896 • Letter: A
Question
As a part of the Healthcare Act, the process for receiving Medicaid services for children has changed. The table below identifies the new 2018 family income eligibility levels based on family size.
Write a program to determine if a family is eligible for Medicaid based on the size of the family and the monthly income of the family.
NOTES:
only families of size 3 or more are eligible for this service (a family is defined as containing at minimum one adult and one child; therefore a family of size 3 could either be 2 adults and one child OR one adult and 2 children)
households must have at least one adult and at most 2 adults; the remaining household members must be all children
only children under the age of 18 are considered eligible
Family Size
3
4
5
6
7 or more
Monthly Income must be less than this amount.
$2981
$3356
$3561
$3689
For each additional child add $622 to the maximum income of a family of 6.
Use the following test cases to be sure your program is valid and meets all the requirements:
TEST1 size = 3, income =2980 (eligible)
TEST2 size = 7, income = 4111 (eligible)
TEST3 size = 7, income= 4555 (NOT eligible)
TEST4 size = 9, income= 5100 (eligible)
TEST5 --> non-numeric input
Family Size
3
4
5
6
7 or more
Monthly Income must be less than this amount.
$2981
$3356
$3561
$3689
For each additional child add $622 to the maximum income of a family of 6.
Explanation / Answer
#include<stdio.h>
#include<ctype.h>
int main()
{
int familysize=0,adult=0,num=0,numberofchildren=0;
float monthlyincome=0.0,income=0.0;
printf(" Enter Family Size ");
scanf("%d",&familysize);
if (isdigit(familysize)) //Check for non Numeric Input
{
if(familysize<3)
printf("Not Eligible");
if(familysize==3) //Check for family of size 3
{
printf(" Enter number of adults");
scanf("%d",&adult);
printf(" Enter Monthly Income");
scanf("%d",&monthlyincome);
printf(" Enter number of children over 18 years");
scanf("%d",&num);
if((adult>=1) && (monthlyincome< 2981) &&(num==0)) //checking condition
printf(" Eligible");
else
printf("Not Eligible");
}
if(familysize==4) //Check for family of size 4
{
printf(" Enter number of adults");
scanf("%d",&adult);
printf(" Enter Monthly Income");
scanf("%d",&monthlyincome);
printf(" Enter number of children over 18 years");
scanf("%d",&num);
if((adult>=1) && (adult <=2) && (monthlyincome< 3356) && (num==0)) //checking condition
printf(" Eligible");
else
printf("Not Eligible");
}
if(familysize==5) //Check for family of size 5
{
printf(" Enter number of adults");
scanf("%d",&adult);
printf(" Enter Monthly Income");
scanf("%d",&monthlyincome);
printf(" Enter number of children over 18 years");
scanf("%d",&num);
if((adult>=1) && (adult <=2) && (monthlyincome< 3561) && (num==0)) //checking condition
printf(" Eligible");
else
printf("Not Eligible");
}
if(familysize==6) //Check for family of size 6
{
printf(" Enter number of adults");
scanf("%d",&adult);
printf(" Enter Monthly Income");
scanf("%d",&monthlyincome);
printf(" Enter number of children over 18 years");
scanf("%d",&num);
if((adult>=1) && (adult <=2) && (monthlyincome< 3689) && (num==0)) //checking condition
printf(" Eligible");
else
printf("Not Eligible");
}
if(familysize>=7) //Check for family of size >=7
{
printf(" Enter number of adults");
scanf("%d",&adult);
printf(" Enter number of children over 18 years");
scanf("%d",&num);
numberofchildren=familysize-adult;
numberofchildren=numberofchildren-num;
income=3689+ (familysize-6)*622; //Calculate income by considering additional children +income of family of 6
printf(" Enter Monthly Income");
scanf("%f",&monthlyincome);
if((adult>=1) && (adult <=2) && (monthlyincome< income) && (num==0)) //checking condition
printf(" Eligible");
else
printf("Not Eligible");
}
}
else
printf(" NonNumeric Input");
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.