Teachavibez
IS-IT--Management
Look at the code below how much can you assist me with this i want the compiler to switch the choice to uppercase in the event that when the program runs the user enters a lowercase string see code below:
Program NationalHousingDevelopmentbyAkarieSmith;
Const
Health=930.00;
Housing=0.02;
Education=0.025;
Union=0.01;
Pension=0.05;
Var
Choice:string;
PensionTax:real;
PAYE:real;
HealthTax:real;
HousingTax:real;
EducationTax:real;
CreditUnionTax:real;
PensionPlan:real;
GrossSalary:real;
TotalDeductions:real;
NetSalary:real;
TotalExpenses:real;
MonthlyExpenses:real;
NetIncome:real;
Balance:real;
firstname:String;
lastname:String;
idnumber:integer;
Repayments:real;
Begin
TotalDeductions:=0.00;
NetSalary:=0.00;
TotalExpenses:=0.00;
NetIncome:=0.00;
Balance:=0.00;
GrossSalary:=0.00;
Writeln('%%%%%%%%%%%%%%National Housing Development%%%%%%%%%%%%%%%');
Write('Enter Applicant Id number:');
Readln(idnumber);
While idnumber <>-1 Do
Begin
Write('Enter the Applicant first name:');
Readln(firstname);
Write('Enter the Applicant Last name:');
Readln(Lastname);
Write('Enter His or Her Gross Salary:','$');
Readln(GrossSalary);
Writeln('');
If (GrossSalary)>30000.00 then
PAYE:=(GrossSalary*0.08)
Else
PAYE:= 0.00;
Writeln('Taxable Deductions');
Writeln('__________________');
Writeln('');
Write('PAYE is:','$',PAYE:7:2);
Writeln('');
HealthTax:=Health;
Write('Health Tax is:','$',HealthTax:7:2);
Writeln('');
HousingTax:=(GrossSalary*Housing);
Write('Housing Tax is:','$',HousingTax:7:2);
Writeln('');
EducationTax:=(GrossSalary*Education);
Write('Education Tax is:','$',EducationTax:7:2);
Writeln('');
CreditUnionTax:=(GrossSalary*Union);
Write('Credit Union Tax is:','$',CreditUnionTax:7:2);
Writeln('');
PensionPlan:=(GrossSalary*Pension);
Writeln('Pension Plan is:','$',PensionPlan:7:2);
Writeln('');
TotalDeductions:=(PAYE+HealthTax+HousingTax+EducationTax+CreditUnionTax+PensionPlan);
Writeln('Total Deductions are:','$',TotalDeductions:7:2);
Write('');
NetSalary:=(GrossSalary-TotalDeductions);
Writeln('');
Writeln('Salary after Taxes','$',NetSalary:10:2);
Writeln('');
Writeln('Select your choice of community');
Writeln('Enter ''AL'' for Angels');
Writeln('Enter ''BO''for Boston');
Writeln('Enter ''CL''for Clarendon Courts');
Readln(Choice);
If (Choice)= 'AL' then
Begin
If NetSalary>50000 then
Writeln('You are Qualified for a house in the Angels Community')
Else
Writeln('You are not Qualified for a house in the Angels Community');
End;
Writeln('');
If (Choice)= 'BO' then
Begin
If NetSalary >37500 then
Writeln('You are Qualified for a house in the Boston Gardens Community')
Else
Writeln('You are not Qualified for a house in the Boston Gardens Community');
End;
Writeln('');
If (Choice)= 'CL' then
Begin
If NetSalary > 27500 then
Writeln('You are Qualified for a house in the Clarendon Courts Community')
Else
Writeln('You are not Qualified for a house in the Clarendon Courts Community');
End;
Writeln('');
Write('Enter Monthly Expenses:','$');
Readln(MonthlyExpenses);
Write('Enter Loan Repayments:','$');
Readln(Repayments);
TotalExpenses:=MonthlyExpenses+Repayments;
NetIncome:=NetSalary-TotalExpenses;
Balance:=TotalExpenses/2;
Writeln('');
If NetIncome>Balance then
Writeln('You are approved for a loan')
Else
Writeln('Sorry to inform you but you are not approved for a loan');
Writeln('');
Writeln('Thank you for selecting National Housing Development');
Writeln('');
Writeln('Enter Applicant Id number');
Readln(idnumber);
End;
End.
Program NationalHousingDevelopmentbyAkarieSmith;
Const
Health=930.00;
Housing=0.02;
Education=0.025;
Union=0.01;
Pension=0.05;
Var
Choice:string;
PensionTax:real;
PAYE:real;
HealthTax:real;
HousingTax:real;
EducationTax:real;
CreditUnionTax:real;
PensionPlan:real;
GrossSalary:real;
TotalDeductions:real;
NetSalary:real;
TotalExpenses:real;
MonthlyExpenses:real;
NetIncome:real;
Balance:real;
firstname:String;
lastname:String;
idnumber:integer;
Repayments:real;
Begin
TotalDeductions:=0.00;
NetSalary:=0.00;
TotalExpenses:=0.00;
NetIncome:=0.00;
Balance:=0.00;
GrossSalary:=0.00;
Writeln('%%%%%%%%%%%%%%National Housing Development%%%%%%%%%%%%%%%');
Write('Enter Applicant Id number:');
Readln(idnumber);
While idnumber <>-1 Do
Begin
Write('Enter the Applicant first name:');
Readln(firstname);
Write('Enter the Applicant Last name:');
Readln(Lastname);
Write('Enter His or Her Gross Salary:','$');
Readln(GrossSalary);
Writeln('');
If (GrossSalary)>30000.00 then
PAYE:=(GrossSalary*0.08)
Else
PAYE:= 0.00;
Writeln('Taxable Deductions');
Writeln('__________________');
Writeln('');
Write('PAYE is:','$',PAYE:7:2);
Writeln('');
HealthTax:=Health;
Write('Health Tax is:','$',HealthTax:7:2);
Writeln('');
HousingTax:=(GrossSalary*Housing);
Write('Housing Tax is:','$',HousingTax:7:2);
Writeln('');
EducationTax:=(GrossSalary*Education);
Write('Education Tax is:','$',EducationTax:7:2);
Writeln('');
CreditUnionTax:=(GrossSalary*Union);
Write('Credit Union Tax is:','$',CreditUnionTax:7:2);
Writeln('');
PensionPlan:=(GrossSalary*Pension);
Writeln('Pension Plan is:','$',PensionPlan:7:2);
Writeln('');
TotalDeductions:=(PAYE+HealthTax+HousingTax+EducationTax+CreditUnionTax+PensionPlan);
Writeln('Total Deductions are:','$',TotalDeductions:7:2);
Write('');
NetSalary:=(GrossSalary-TotalDeductions);
Writeln('');
Writeln('Salary after Taxes','$',NetSalary:10:2);
Writeln('');
Writeln('Select your choice of community');
Writeln('Enter ''AL'' for Angels');
Writeln('Enter ''BO''for Boston');
Writeln('Enter ''CL''for Clarendon Courts');
Readln(Choice);
If (Choice)= 'AL' then
Begin
If NetSalary>50000 then
Writeln('You are Qualified for a house in the Angels Community')
Else
Writeln('You are not Qualified for a house in the Angels Community');
End;
Writeln('');
If (Choice)= 'BO' then
Begin
If NetSalary >37500 then
Writeln('You are Qualified for a house in the Boston Gardens Community')
Else
Writeln('You are not Qualified for a house in the Boston Gardens Community');
End;
Writeln('');
If (Choice)= 'CL' then
Begin
If NetSalary > 27500 then
Writeln('You are Qualified for a house in the Clarendon Courts Community')
Else
Writeln('You are not Qualified for a house in the Clarendon Courts Community');
End;
Writeln('');
Write('Enter Monthly Expenses:','$');
Readln(MonthlyExpenses);
Write('Enter Loan Repayments:','$');
Readln(Repayments);
TotalExpenses:=MonthlyExpenses+Repayments;
NetIncome:=NetSalary-TotalExpenses;
Balance:=TotalExpenses/2;
Writeln('');
If NetIncome>Balance then
Writeln('You are approved for a loan')
Else
Writeln('Sorry to inform you but you are not approved for a loan');
Writeln('');
Writeln('Thank you for selecting National Housing Development');
Writeln('');
Writeln('Enter Applicant Id number');
Readln(idnumber);
End;
End.