: Basically i have to create a main program whih a list appears and a
: user can select one of the following
:
: Press 1 for farenheit - celcius
: press 2 for dollars - pounds
: press 3 for cm - inches
: press 4 for lbs - stone
:
: the user would then press a number for example they press number 3.
: The user then enters a number which then is converted from cm -
: inches.
:
: The program then stops and asks the user if he/she wants to continue
: if the answer is yes then it will take them back to the main program
: where they can select a new number to convert something else such as
: lbs, dollars etc.
:
:
This code should put you on the track, all you have to do is just expand it to have all the menu items working. You can use the temp. conversion function as a template and write the conversion parts for each of the functions.
uses crt;
function convert_farenheit:boolean;
var fvalue:real;
ch:char;
begin
write(#13#10#248'F=');readln(fvalue);
{...}
{ conversion part goes here }
{...}
writeln('Press: Esc to Quit, Enter to Continue');
repeat ch:=readkey; until ((ch=#27) or (ch=#13));
convert_farenheit:=ch=#13;
end;
function main_loop:boolean;
var ch:char;
begin
writeln(#13#10#13#10'Press: 1 - Farenheit <=> Celsius');
writeln(' 2 - Dollars <=> Pounds');
writeln(' 3 - Cm <=> Inches');
writeln(' 4 - Lbs <=> Stone');
writeln(' 5 - Exit');
repeat
ch:=readkey;
case ch of
'1':main_loop:=convert_farenheit;
{'2':...
'3':...
'4':... }
'5':main_loop:=false;
end;
until (ch in ['1'..'5']);
end;
begin while main_loop do;end.