0% found this document useful (0 votes)
95 views7 pages

Algorithm To Determine If An Applicant Is Approved For An Allocation in A Named Housing Community

The document describes an algorithm to determine if housing applicants are approved for an allocation. It identifies constants like minimum income thresholds and variables like applicant name, income, expenses. It calculates an applicant's net and disposable income, determines if they are qualified, and their approval status. It iterates through a maximum of 5 applicants, tracking totals and averages of approved applicants' net income.

Uploaded by

JEREMIAH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views7 pages

Algorithm To Determine If An Applicant Is Approved For An Allocation in A Named Housing Community

The document describes an algorithm to determine if housing applicants are approved for an allocation. It identifies constants like minimum income thresholds and variables like applicant name, income, expenses. It calculates an applicant's net and disposable income, determines if they are qualified, and their approval status. It iterates through a maximum of 5 applicants, tracking totals and averages of approved applicants' net income.

Uploaded by

JEREMIAH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Problem Statement

Algorithm to determine if an applicant is approved for an allocation in a named housing


community.
Pseudocode

Begin
Identify Constants
PC as integer ←$45,000
GC as integer←$35,800
PS as integer ←$25,000
Identify Variables
App_Name as string
HCC as String
Gross_Sal as real
Total_Sal_Deduc as real
Total_Expenses as real
Total_loan_payments as real
Net_Inc as real
Disc_Inc as real
Appro_Status as string
Q_Status as string
Amount_Of_App as integer
Appro_Num as integer
Appro_Sum as real
App_Net_Inc_Avg as real
Begin
Amount_of_app = 0
Appro_Sum=0
Appro_Num=0
While Amount_of_app < 5 DO
Write “Enter the name of the applicant”
Read App_Name
Write “Enter the housing community code of the applicant”
Read HCC
Write “Enter the gross salary of the applicant”
Read Gross_Sal
Write “Enter the salary deductions of the applicant”
Read Total_Sal_Deduc
Write “Enter the total expenses of the applicant”
Read Total_Expenses
Write “Enter the total loan payments of the applicant”
Read Loan
Net_Inc← Gross_Sal – Total_Sal_Deduc
If Net_Inc ≥ PC then
Q_Status= “Qualified”

Else
If Net_Inc ≥ PC then
Q_Status= “Qualified”
Else
If Net_Inc ≥ PS then
Q_Status = “Qualified”

Else
Q_Status= “Not qualified”
Write “Not Qualified”
Endif
Endif
Endif
If Q_Status = “Qualified” Then
Disc_Inc←Net_Inc – ( Total_Expenses+Total_Loan_payments )
Endif
If Disc_Inc ≥0.5*Net_Inc then
Appro_Status= “Approved”
Else
Appro_Status= “Not approved”
Endif
If Appro_Status = “Approved”
Appro_Sum← Appro_Sum + Net_Inc
Endif
If Appro_Status = “Approved” Then
Appro_Num ← Appro_Num + 1
Else
Appro_Num ← Appro_Num + 0
Endif
Print “The name of the applicant is”, App_Name
Print “The Housing Community Applied for is”, HCC
Print “The Qualification of the Applicant is”,Q_Status
Print “The Approval Status of the Applicant is”,Appro_Status
Amount_Of_App = Amount_Of_Apps + 1
Endwhile
App_Net_Inc_Avg = Appro_Sum/Appro_Num
Print “The Number of Approved applicants is”, Appro_Num
Print “The Number of Applicants is”,Amount_Of_App
Print “The Average Net Income of Approved Applicants is “, App_Net_Inc_Avg
End;
End.
Program Monte_Vista_Housing_Community; {Program header}

{A Program to Accept and Store the data of applicants for the Monte Vista Housing Development Agency; Inorder to

calculate the net income of the applicants, determine if they are qualified for an allotment of a house in the

applied for community, calculate their disposable income and determine the approval status .}

Const

PC=$45000; {This is the qualifying income for the community of pebble creek.}

GC=$35800; {This is the qualifying income for the community of Gold Canyon.}

PS=$25000; {This is the qualifying income for the community of Palm Springs.}

Var

App_Name:String; {This variable will store the name of the applicant.}

HCC:String; {This variable will store the Housing community code that the applicant has applied for}

Gross_Sal:real; {This will store the salary of the applicant before any deductions.}

Total_Sal_Deduc:real; {This holds the deductions from the salary of an applicant.}

Total_Expenses:real; {This holds the amount of money the applicant spends per month.}

Total_Loan_payments:real; {This holds the total amount of money that the applicant needs to be repay to the
bank.}

Net_Inc:real; {This is the income of the applicant after tax.}

Disc_Inc:real; {This is the income of the applicant after all deductions also known as the balance.}

Appro_Status:string; {Determines whether an applicant is approved or not.}

Q_Status:string; {Determines whether an applicant is qualified or not for the applied housing community.}

Amount_of_app:integer; {This is the control and it stores how many people have applied for Monte Vista Housing.

Appro_Num:integer; {Number of people that have been approved for a house in the community they applied for.}

Appro_Sum:real; {This the total Net income of all approved applicants.}

App_Net_Inc_Avg:real; {This the average Net income among all applicants.}

Begin

Writeln('Created by Shanice Russell');

Writeln('Titchfield High School');

Writeln('Completed February 27th 2019');

Writeln('Programming SBA');

Writeln;
Writeln('For the purpose of determining the approval of applicants for an allocation in the Pebble creek,Gold
canyon,');

Writeln('or Palm spring housing community');

Writeln('Please follow the instructions and enter all the necessary information');

Writeln;

Writeln('Thank you!');

Writeln('****************************************************************************************
*****************');

Amount_of_app:=0;

Appro_Sum:=0;

Appro_Num:=0;

While Amount_of_App<5 DO

Begin {Beginning of Input}

Writeln;

Writeln('Enter the name of the applicant then press Enter');{Prompts user to enter name of the applicant}

Readln(App_Name); {Memory reserved for the user to enter the name}

Writeln('Enter the housing community code of the applicant then press Enter');

Readln(HCC);

Writeln('Enter the gross salary of the applicant then press enter');

Readln(Gross_Sal);

Writeln('Enter the total salary deductions of the applicant then press enter');

Readln(Total_Sal_Deduc);

Writeln('Enter the total expenses of the applicant then press Enter');

Readln(Total_Expenses);

Writeln('Enter the Total Loan Payments of the applicant then press Enter');

Readln(Total_Loan_payments);

Writeln;

Net_Inc:= Gross_Sal - Total_Sal_Deduc;

If Net_Inc>=PC then

Q_Status:='Qualified'

Else

Q_Status:='Not Qualified';

{Endif}
If Net_Inc>=GC then

Q_Status:='Qualified'

Else

Q_Status:='Not Qualified';

{Endif}

If Net_Inc>=PS then

Q_Status:='Qualified'

Else

Q_Status:='Not Qualified';

{Endif}

{Endif}

{Endif}

If Q_Status='Qualified'Then

Disc_Inc:=Net_Inc-(Total_Expenses+Total_loan_payments);

{Endif}

If Disc_Inc>=0.5*Net_Inc then

Appro_Status:='Approved'

Else

Appro_Status:='Not approved';

{Endif}

If Appro_Status='Approved'then

Appro_Sum:=Appro_Sum +Net_Inc;

{Endif}

If Appro_Status='Approved' Then

Appro_Num:= Appro_Num + 1

Else

Appro_Num:= Appro_Num + 0;

{Endif}
Writeln('The Name of the applicant is ',App_Name);

Writeln('The Housing Community Applied for is ',HCC);

Writeln('The Applicant is ',Q_Status);

Writeln('The Approval Status of the Applicant is ',Appro_Status);

Amount_Of_App:= Amount_Of_App + 1;

End;

{Endwhile}

Writeln;

Writeln;

App_Net_Inc_Avg:=Appro_Sum/Appro_Num;

Writeln('The number of approved applicants is ', Appro_Num);

Writeln('The number of applicants is ',Amount_Of_App);

Writeln('The average net income of approved applicants is ',App_Net_Inc_Avg:7:2);

End.

You might also like