Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Interpreted or Compiled????feel free to correct me cuz i think i need Posted by Destiny007 on 7 Apr 2003 at 9:44 AM
Im not sure but i know Pascal is a compiled language but am confused about if the following are correct, if anyone can correct me please do.....]

Java- Interpreted??
COBOL-Interpreted
C++- Compiled???

What would the computer display as the answer tothe following calculation:

6+8/2*4-5???
i got the following...4.2 but feel im wrong.

Also assuming the variables A,B,C and D hold the values shown would the following codes be executed or ignored?

1. if(A>10)and(B=6)then....?
2. if(C=10)or(B=6)then...?
3. if(A=10)and(B>=5)or(D=-5)then...?
4. if NOT(A=10)and(C<22)then...?

(im confuised with the above for real!)

* How cud i use Pascal to perform a conditional branch to make it repeat a block of code 8 times ?

* I dont know what Pascal variable data-type would be used to hold the following values:
1)3.123878?
2)10?

* Where could i go in terms of a website where i could find out about 'Von Neumann Architecture'based CPU and they can explain what the function of each section is?????


PLEASE ALL REPLIES WOUDL BE GRATEFUL!X
Report
Re: Interpreted or Compiled????feel free to correct me cuz i think i n Posted by Manning on 7 Apr 2003 at 10:25 AM
Sounds like homework so I dont want to give direct answers. This should help though:

: What would the computer display as the answer tothe following calculation:
:
: 6+8/2*4-5???
: i got the following...4.2 but feel im wrong.

I dont know about all compilers, but in Pascal it'll follow the order of operations (BEDMAS) so the answer will not be 4.2

: Also assuming the variables A,B,C and D hold the values shown would the following codes be executed or ignored?
:
: 1. if(A>10)and(B=6)then....?
: 2. if(C=10)or(B=6)then...?
: 3. if(A=10)and(B>=5)or(D=-5)then...?
: 4. if NOT(A=10)and(C<22)then...?
:
: (im confuised with the above for real!)

This is easy to answer. Just put the code into a program and have it write something if the IF THEN evaluates to true. It's easy to see which ones are executed then.

: * How cud i use Pascal to perform a conditional branch to make it repeat a block of code 8 times ?

Lots of ways. The preferred would be to use the style that lets you specify the start and end values (where you would specify 1 for start and 8 for end)

: * I dont know what Pascal variable data-type would be used to hold the following values:
: 1)3.123878?
: 2)10?

Most people would say a floating point for 1) and a non-floating point for 2). Personally I would say floating point for both, since it's technically correct.

: * Where could i go in terms of a website where i could find out about 'Von Neumann Architecture'based CPU and they can explain what the function of each section is?????

www.google.com would be my first pick



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.