WWW.VIRTUALeMEDIA.COM

CONTACT US  |  HOMEPAGE

VIRTUALeMEDIA                   SOFTWARE ENGINEERING
CLOTHING  ::  ELECTRONICS  ::  HARDWARE  ::  GIFTS  ::  BOOKS  ::  FINANCE  ::  SOFTWARE  ::  EMPLOYMENT ::   VIRTUAL OFFICES
COOL STUFF

AUDIO

COMPUTERS

NETWORKS

PDAs

SUPPLIES

TELEVISIONS

WIRELESS

TECHNOLOGY

ARTICLES

HARDWARE

SOFTWARE

PROGRAMMING

WEBMARKETING

WIRELESS


LINKS

 
 

FREELANCING

VIRTUALeOFFICES

TRADELINKS

 

GEMINISOFTWARE

 

 

 

 

 

 

 

Allume Systems Software     Record Streaming Video. CLICK HERE!          SnapDialer: use cellphone to connect PC to the web     GEAR CD/DVD Burning Software     

_________________________________________________________________________________________

LearnKey Training

___________________

 

Welcome to our website

 

{$P256,G256,B-}


{ THIS PASCAL PROGRAM IS A TWO FUNCTION CALCULATOR. TO USE THIS }
{ CALCULATOR JUST ENTER ANY +,-,*,/ TYPE CALCULATIONS. }
{ THEN HIT 'ENTER' TWICE TO RECEIVE A RESULT AND THE }
{ OPTION TO QUIT? (Y/N) . }

program calculator(input,output);

const blank = ' ';

var oprand1 : real;
outfile : text;
flag : boolean;
ch : char; { OPERATOR }

{********************************************************************}

function compute(operand1 : real; var outfile : text) : real;
var num,operand2 : real;

function skipblanks : char; { SKIPS ALL BLANKS BEFORE THE OPERATOR }
var ch : char; { AND RETURNS TO COMPUTE THE OPERATOR. }

begin { SKIPBLANKS }
read(kbd,ch);
while ch = blank do
read(kbd,ch);
skipblanks := ch { ASSIGNS SKIPBLANKS TO THE FIRST NONBLANK }
end; { SKIPBLANKS } { CHARACTER.}

begin { FUNCTION COMPUTE }
case skipblanks of { THIS CASE REVIEVES THE FIRST NONBLANK }
'+' : begin { CHARACTER AND ASSIGNS IT TO THE CORRECT }
write(outfile,operand1:1:1); { ASSIGNMENT STATEMENT.}
readln(kbd,operand2);
writeln(outfile,' + ',operand2:3:1);
num := operand1 + operand2;
end;
'-' : begin
write(outfile,operand1:1:1);
readln(kbd,operand2);
writeln(outfile,' - ',operand2:3:1);
num := operand1 - operand2;
end;
'*' : begin
write(outfile,operand1:1:1);
readln(kbd,operand2);
writeln(outfile,' * ',operand2:3:1);
num := operand1 * operand2;
end;
'/' : begin
write(outfile,operand1:1:1);
readln(kbd,operand2);
writeln(outfile,' / ',operand2:3:1);
num := operand1 / operand2;
end;
end;
write(outfile,' RESULT : ' );
compute := num
end; { FUNCTION COMPUTE }

{********************************************************************}

function quit(ch : char) : boolean;
{ THIS FUNCTION DETERMINES WHETHER OR }
begin { FUNCTION QUIT } { NOT THE USER WISHES TO CONTINUE }
if upcase(ch) = 'Y' then { USING THE CALCULATOR.}
quit := false;
if upcase(ch) = 'N' then
quit := true
end; { FUNCTION QUIT }



{********************************************************************}

begin { MAIN }
clrscr; { CLEARS THE SCREEN. }
flag := true;
assign(outfile,'CON' ); { ASSIGNS OUTPUT TO THE SCREEN. }
rewrite(outfile);
while flag do begin { AS SOON AS THE USER SAYS 'Y' }
writeln(outfile); { FLAG WILL BECOME FALSE. }
writeln(outfile);
write(outfile,' COMPUTE > '); { USER PROMPT.}
read(kbd,oprand1);
writeln(outfile,compute(oprand1,outfile):1:1);
write(outfile,' QUIT? (Y/N) '); { USER PROMPT.}
read(kbd,ch);
read(kbd,ch);
flag := quit(ch); { ASSIGNS FUNCTION QUIT.}
write(outfile,ch);
end; { WHILE }
close(outfile);
end.

 

_________________________________________________________________________________________

 

 

 

 

 

 

About Us

Content provided by VirtualeCorporation

 
 

 

 

Google

GeminiSoftwareSystems     GeminiMalls     GeminiMagazine     TradeLinks

VirtualeCatalog     VirtualeCorporation     VirtualeDirectory     VirtualeJobs     VirtualeMedia     VirtualeOffices

_______________________________________________________________________________________

Give to Charities Click Here!

Michael J. Fox Parkinson's Website Click Here!

__________________________________________

Software including hosting, websites, graphics, development, office, security..Click Here!

 

________________________________________________________________________________________

Save up to 75% on software     CoffeeCup Software     GoToMyPC - Access Your PC From Anywhere     Students software at 50% off!     Get New Emoticons     www.ITCFonts.com

 

Buy Online at Autodesk

"Internet Security Systems' BlackICE Protection Products"

 Need to create a business plan now? Get OfficeReady Business Plans

 Kaspersky Anti-Virus Products

 Free Shipping when you spend $100 on Macromedia.com

 Convert paper and PDF into Documents you can edit, share and archive - Buy OmniPage Pro from ScanSoft.

 Broderbund Bargain Bin - All Titles Under $9.99! Plus FREE shipping with orders over $20!

GameFly® Video Game Rentals - Free Trial          Free Stuff     Aces High 88 Button          

_____________________

Simpson's Monopoly

 

 

 

Google

 

 

 

 

© COPYRIGHT 2002 ALL RIGHTS RESERVED YOURDOMAIN.COM

CLOTHING  ::  ELECTRONICS  ::  HARDWARE  ::  GIFTS  ::  BOOKS  ::  FINANCE  ::  SOFTWARE  ::  EMPLOYMENT     VIRTUAL OFFICES