No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
ok, im making a basic program in pascal. like a text based calculator (i dont know how to make GUIs) so lets say i have a peice of code like this: [CODE]program test; var A,B,C:real; begin writeln('enter the first number'); readln(A); writeln('enter the second number'); readln(B); C:=A/B; writeln('your answer is: … |
|
all work perfectly just the substraction here's the code: [code=pascal]Program calculation; uses wincrt; Procedure menu; Begin Writeln('Options:'); Writeln('1. Addition'); Writeln('2. Subtraction'); Writeln('3. Mutiplication'); Writeln('4. Division'); Writeln('5. Exit'); End; Function GetUserInput(msg:string):integer; Var UserInput:integer; Begin Write(msg); Read(UserInput); GetUserInput:=Userinput; End; Procedure Add; var add:integer; Begin clrscr; add:=GetUserInput('Enter another number:')+GetUserInput('Enter a number:'); writeln('Result=',add); End; … |
|
create an array of marks [1..5] then create a while loops to ask the user for 5 marks then displayed all stired marks. [code=pascal]program marks; var mark:array[1..5] of integer; x:integer; counter:integer; Begin counter:=1; x:=1; while (counter<=5) do begin writeln('input marks'); readln(mark[x]); x:=x+1; counter:=counter+1; end; writeln(mark[3]); end.[/code] thankx in advanced for … |
|
hi program to ask the user a username and a password if pass and username good display OK else clear screen and reask the user for username and password again. this will continue until good username and password entred. using while loops thanks in advanced |
|
Re:
Hi guys :) I've just learn programming in turbo pascal, and my teacher made an assignment to make pyramid of numbers as this: [code] 1 1 2 1 2 3 3 2 1 2 1 1 [/code] so far i've only come up as this: [code] uses crt; var i,j,k … |