INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to convert entered string into Uppercase in EZYPASCAL

How to convert entered string into Uppercase in EZYPASCAL

(OP)
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.


RE: How to convert entered string into Uppercase in EZYPASCAL

Hi

No idea what is that EZYPASCAL exactly, please provide a link to its online documentation if you are aware of any.

In case EZYPASCAL has SysUtils unit, that should contain an UpperCase() function, so :

CODE --> (fragments)

program NationalHousingDevelopmentbyAkarieSmith;

uses
  SysUtils;

const
  Health=930.00;

{ ... }

    Writeln('Enter ''CL''for Clarendon Courts');
    Readln(Choice);
    Choice:=UpperCase(Choice);
    if (Choice)= 'AL' then
    begin

{ ... } 
The above suggested modifications work in Delphi/Kylix and FreePascal.

Please choose an Indent style and use it consistently. Next time please post your code between [code] and [/code] TGML tags.

Feherke.
http://feherke.github.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close