Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 turing questions help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bloodyeric12




PostPosted: Mon Apr 23, 2012 7:44 pm   Post subject: turing questions help

Output the times-tables (from 1 to 12) for whichever number the user requests. For example, if the user enters 3, your output should be:

1 x 3 = 3



2 x 3 = 6



...



12 x 3 = 36



2. Modify question #3 to allow the user to specify the start and end to the table (e.g., 4 to 15).

3. The Fibonacci numbers are a sequence of numbers where the next number in the sequence is the sum of the previous two numbers. The first number is 0 and the second number is 1. Write a program that outputs the first N numbers in the sequence, starting with 0. The user should be asked how many numbers of the sequence to output. Save as

For Example: The first 7 numbers are 0 1 1 2 3 5 8

TY IN ADVANCE
Sponsor
Sponsor
Sponsor
sponsor
evildaddy911




PostPosted: Mon Apr 23, 2012 8:27 pm   Post subject: RE:turing questions help

here at compsci, we dont do your homework for you. Turing Help is for helping people understand why some things happen. If you need help getting started, ask a classmate or the teacher.

However, some of us will give hints to help you get started, such as, "use for loops for the first two questions"
Amarylis




PostPosted: Mon Apr 23, 2012 9:15 pm   Post subject: RE:turing questions help

And by the way, Turing crashes at the 45th (or around that) Fibbonaci number....


And take a look at for loops
Tony




PostPosted: Mon Apr 23, 2012 11:06 pm   Post subject: Re: RE:turing questions help

Amarylis @ Mon Apr 23, 2012 9:15 pm wrote:
And by the way, Turing crashes at the 45th (or around that) Fibbonaci number....

Turing doesn't have a build in "get_fibonacci(n)" function... the crash (or lack there of) depends on the implementation.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Amarylis




PostPosted: Tue Apr 24, 2012 6:52 am   Post subject: RE:turing questions help

Oh, mine crashed cuz the integer value was too big Razz
Raknarg




PostPosted: Tue Apr 24, 2012 11:49 am   Post subject: RE:turing questions help

I think it depends on whether or not you use recursion. If you do, it crashes faster than using a loop
Tony




PostPosted: Tue Apr 24, 2012 12:07 pm   Post subject: RE:turing questions help

The next barrier is solved with using BigInts for a datatype.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: