programming of qbasic

by (no login)

 

1 Write a BASIC computer program to calculate the circumference of a
circle. Given that circumference of a circle is 2II r. Take 3.142 for
II and 6cm for radius (r)

2 After writing the program, compile it and debug necessary errors on
the computer system

3 Print out the output result on a paper

4 Re-run the program for the second time and change the value of
radius to be 8cm and reprint out the output result on paper

Please i need someone to write out the code i suppose to input and the version of qbasic i can use with windows xp DOS that will accept the code

Thanks all

Posted on May 24, 2011, 10:03 AM

Respond to this message   

Return to Index

Response TitleAuthor and Date
* link on May 24
Re: programming of qbasic on May 24
 At least tell him how to get Pi properly!Unseen on May 24
  *Yes, but the specification said "Take 3.142 for II". I'd say follow the spec. on May 24
  *A fair approximation of Pi: 355/113 on May 25
   that's only 7 digitsunclejed613 on Jun 22
    * You don't need to guess! ... PI# = 4 * ATN(1#) on Jun 22
     and the reason... on Jun 23
      Unfortunately Qbasic won't allow it to define a CONSTant on Jun 23
       * I don't see why not... C and C++ both allow it... on Jun 23
        Because Galleon seems to LIKE ERRORS! on Jun 23
       Re: Unfortunately Qbasic won't allow it to define a CONSTant on Jun 23
        I tried to get a Constant PI value for QB64 on Jun 23
         Don't really see the point of CONSTDavid on Jun 24
          * Um... Avogardo's number is 6.022e23 not 6.626e23...qbguy on Jun 24
           So that's why I get the wrong answerDavid on Jun 24
            * THATS THE REASON! You CAN FORGET THEM silly! on Jun 24
          Re: Don't really see the point of CONST on Jun 24
           a quick disclaimer on Jun 24
            Yes I think you're correctDavid on Jun 24
         _pi, perhaps... on Jun 24
    *welcome to the forum, unclejed. on Jun 23
Here's some help with step 1...Galleon on May 25
 programming of qbasic on May 25
  Copy text from QB to an outside source.Solitaire on May 25
   Huh? on May 25
   Re: Copy text from QB to an outside source. on May 25
    RE: The QB window Edit menu; Screen image.Solitaire on May 25
     Yeah, but that also copies the Menu and side bars on May 25
     Re: RE: The QB window Edit menu; Screen image. on May 26
      *Thank you. Right-clicking works. Left-clicking only works on the icon.Solitaire on May 26
 Your program gives wrong results...qbguy on May 26
  Setup to fail...Galleon on May 27
   * That teacher probablt spent a month on LET... :-) on May 27
   Re: Setup to fail... on May 27
    This is the correct way to do it, right?qbguy on May 27
     * :-P on May 27
   * Change c = c + 3.142 / (4 * ATN(1)) to c = c + 1 + ATN(1/radius) for more accuracyqbguy on May 27
 programming of qbasic on May 31
  What part of this don't you understand? link on May 31
  As Solitaire told you: ALT+ENTER on May 31

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement