Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jun 6th, 2005, 8:23 AM   #1
Lightninghawk
Programmer
 
Join Date: Jun 2005
Location: Douglas, Ga - USA
Posts: 32
Rep Power: 0 Lightninghawk is on a distinguished road
Send a message via MSN to Lightninghawk Send a message via Yahoo to Lightninghawk
Pascal Question

  1. <LI class="code-row code-row-first">Program FormulaResolvente; <LI class=code-row>uses <LI class=code-row>crt; <LI class=code-row>var <LI class=code-row>A : real; <LI class=code-row>B : real; <LI class=code-row>C : real; <LI class=code-row>D : real; {o k ta dentro da raiz kuadrada da formula resolvente} <LI class=code-row>X : real; {coordenada X do vertice} <LI class=code-row>raiz1 : real; <LI class=code-row>raiz2 : real; <LI class=code-row>Begin <LI class=code-row>clrscr; <LI class=code-row>writeln( 'Introduz o valor de A:' ); <LI class=code-row>readln( A ); <LI class=code-row>writeln( 'Introduz o valor de B:' ); <LI class=code-row>readln( B ); <LI class=code-row>writeln( 'Introduz o valor de C:' ); <LI class=code-row>readln( C ); <LI class=code-row>d:= (b*b)-(4*a*c); <LI class=code-row>if d < 0 then <LI class=code-row>writeln('Raizes de nºs negativos nao existem Razz') <LI class=code-row>else <LI class=code-row>raiz1:= (-b+sqrt(d))/(2*a); <LI class=code-row>raiz2:= (-b-sqrt(d))/(2*a); <LI class=code-row>BEGIN <LI class=code-row>writeln('1ª Raiz = ',raiz1); <LI class=code-row>writeln('2ª Raiz = ',raiz2); <LI class=code-row>END; <LI class=code-row>X:= (raiz1+raiz2)/2; <LI class=code-row>Begin <LI class=code-row>writeln('Coordenada X do vertice : ',X); <LI class=code-row>writeln('Coordenada Y do vertice : ',(A*sqr(x))+(B*X)+C); <LI class=code-row>while not keypressed do; <LI class=code-row>end;
  2. end.

Ok, I´ll say what the problem is: the command "while not keypressed do" just function when D<0..well that's a real big problem because D can also be >0 and then the window closes before showing the coordinate of the vertex of the parable...

NOTE: some of this program is in Portuguese, but it should not matter.
__________________

+_-¤ ŦĦễ £ﺄĢĦŧňĨňĢĦǻщk ¤-_+
- PC Apps Specialist, Networking n00b, programmer in training -

Information Technology Support


Last edited by big_k105; Jun 6th, 2005 at 9:32 AM.
Lightninghawk is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:06 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC