Вы находитесь на странице: 1из 3

Pseudocode

Start
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
Gros_Sal as real
Sal_Ded as real
Exp as real
Loan as real
Net_Inc as real
Dis_Inc as real
App_Stat as string
Q_Status
Amount_Of_Apps as integer
Appr_Num as integer
Appr_Sum as real
Appr_Avg as real
Start
Amount_Of-Apps = 0
Appr_Sum=0
Appr_Num=0
While Amount_Of_Apps < 50 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 Applicant’s Gross Salary”
Read Gros_Sal
Write “Enter Salary Deductions”
Read Sal_Ded
Write “Enter Total Expenses”
Read Exp
Write “Enter Total Loan Payments”
Read Loan
Net_Inc← Gros_Sal – Sal_Ded
If Net_Inc ≥ GC then
Write “Qualifies for GC”
Else
If Net_Inc ≥ PC then
Q_Status= “Qualified”
Write “Qualifies for PC”
Else
If Net_Inc ≥ PS then
Q_Status = “Qualified”
Write “Qualifies for PS”
Else
Q_Status= “Not qualified”
Write “Not Qualified”
Endif
Endif
Endif
If Q_Status = “Qualified” Then
Dis_Inc←Net_Inc –(Exp+Loan)
Endif
If Dis_Inc ≥0.5*Net_Inc then
App_Stat= “Approved”
Else
App_Stat= “Not approved”
Endif
If App_Stat = “Approved”
Appr_Sum← Appr_Sum + Net_Inc
Endif
If App_Stat = “Approved” Then
Appr_Num ← Appr_Num + 1
Else
Appr_Num ← Appr_Num + 0
Endif
Print “The Applicant’s Name 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”,App_Stat
Amount_Of_Apps = Amount_Of_Apps + 1
Endwhile
Appr_Average = Appr_Sum/Appr_Num
Print “The Number of Approved applicants is”, Appr_Num
Print “The Number of Applicants is”,Amount_Of_Apps
Print “The Average Net Income of Approved Applicants is “, Appr_Average
End
End

Вам также может понравиться