Did you read the Homework Help link Clippy gave you?
We won't do your homework for you. You need to show the initiative to do it yourself. This is not a very difficult assignment. The only difficulty is that they want the result on paper. I would say output it to a file, and then print it with Notepad...
I believe it can be done correctly in 11 lines of code, including variable declarations (3 lines), variable assignment (3 lines), output to a file (3 lines), executing Notepad to print the file (1 line), terminating the program (1 line).
Actually, it doesn't even seem that the program needs to print it, only display it, and the user print it. In that case, 8 lines of code should suffice.
Try it, post your effort, and then we can help you...
Return to Index
|Response Title||Author and Date|
|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.||Michael Calkins on May 24|
|*A fair approximation of Pi: 355/113||Kewbie on May 25|
|that's only 7 digits||unclejed613 on Jun 22|
|* You don't need to guess! ... PI# = 4 * ATN(1#)||Clippy on Jun 22|
|and the reason...||Michael Calkins on Jun 23|
|Unfortunately Qbasic won't allow it to define a CONSTant||Clippy on Jun 23|
|* I don't see why not... C and C++ both allow it...||ChronoKitsune on Jun 23|
|Because Galleon seems to LIKE ERRORS!||Clippy on Jun 23|
|Re: Unfortunately Qbasic won't allow it to define a CONSTant||Michael Calkins on Jun 23|
|I tried to get a Constant PI value for QB64||Clippy on Jun 23|
|Don't really see the point of CONST||David 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 answer||David on Jun 24|
|* THATS THE REASON! You CAN FORGET THEM silly!||Clippy on Jun 24|
|Re: Don't really see the point of CONST||Michael Calkins on Jun 24|
|a quick disclaimer||Michael Calkins on Jun 24|
|Yes I think you're correct||David on Jun 24|
|_pi, perhaps...||Michael Calkins on Jun 24|
|*welcome to the forum, unclejed.||Michael Calkins on Jun 23|