#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Creating a program Help please

Posts: 1Member
Hello i'd appreciate if someone could help me with creating a program

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.

I'm very new to pascal, i'd appreciate if someone could help me on this as i really don't have a clue how to do it . Thanks

• Posts: 163Member
: 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.[code][color=Blue]uses crt;

function convert_farenheit:boolean;
var fvalue:real;
ch:char;
begin
{...}
{ 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