Computer Science Canada

i need help

Author:  fire581 [ Tue Nov 29, 2005 4:11 pm ]
Post subject:  i need help

i need help with turing...im clueless

problem:

create a program that will ask the user for an interger between 1 and 50.the program should output all the prime factors of that integer

Author:  Albrecd [ Tue Nov 29, 2005 4:16 pm ]
Post subject: 

Asok said:
Quote:
the compsci.ca staff would like to inform you that any thread with the topic title is general such as "I need help" "help me please" "Help fast ASAP" will be deleted and you will not recieve help

Author:  person [ Tue Nov 29, 2005 4:20 pm ]
Post subject: 

ask us a question and we'll help, ask us to do ur hwk, and u'll ge flamed[/quote]

Author:  fire581 [ Tue Nov 29, 2005 4:26 pm ]
Post subject: 

k fine....i can do some of the program, its just i have no idea how to make the make the program find the prime factors. all i know is that it uses 'div' and/or 'mod'......i think

Author:  fire581 [ Tue Nov 29, 2005 4:39 pm ]
Post subject: 

ummm is anyone gonna hepl me.....if no say so, so i dont wait in front of my comp like an idiot while i could be doing something much more productive

Author:  Tony [ Tue Nov 29, 2005 4:44 pm ]
Post subject: 

such as learning how to program perhaps?

Author:  Albrecd [ Tue Nov 29, 2005 4:46 pm ]
Post subject: 

You should probably do something more productive. We will try to help, but it will probably take longer for us to answer than you want to wait... This is a Forum, not a chat room.

Author:  fire581 [ Tue Nov 29, 2005 4:49 pm ]
Post subject: 

u didnt answer my question, and im only in grd.7 and turing is new to me and i made a big mistake, taking advanced course....but probably a bigger mistake was asking you lot

Author:  fire581 [ Tue Nov 29, 2005 4:50 pm ]
Post subject: 

btw that last post was meant to go to the moderator person, not the person who actually offered help

Author:  Tony [ Tue Nov 29, 2005 4:53 pm ]
Post subject: 

primes?
factors?

it's all there Wink

Author:  Albrecd [ Tue Nov 29, 2005 4:56 pm ]
Post subject: 

You should post at least a start to your program so that we can help you with it. Otherwise, we're doing it for you. If you can't even start, you should talk to your teacher, they can help you learn. (It's kinda why they exist)

Author:  fire581 [ Tue Nov 29, 2005 5:54 pm ]
Post subject: 

i didnt realise u said that until a short while ago(i was doing something productive)
yea will this is what i got....the very advanced ppl who read this are gonna hav a good laugh, and something funny to tell their equally advanced frends....

%A program that asks for a number and outputs its prime facotrs.

%Variable Declarations
var newint:int
var factors:int

%Input
put"Input a number between 1 and 50. "..
get newint

%Processing/Output
factors:=newint mod 2
if factors = 0
then put 2

factors:=newint mod 3
elsif factors=0
then put 3

factors:=newint mod 5
elsif factors=0
then put 5

factors:=newint mod 7
elsif factors=0
then put 7

factors:=newint mod 11
elsif factors=0
then put 11

factors:=newint mod 13
elsif factors=0
then put 13

factors:=newint mod 17
elsif factors=0
then put 17

factors:=newint mod 19
elsif factors=0
then put 19

factors:=newint mod 23
elsif factors=0
then put 23

end if

it obviously doesnt work, and i need to be enlightened

Author:  MysticVegeta [ Tue Nov 29, 2005 6:46 pm ]
Post subject: 

Isnt there a post that I posted with Prime factors using recursion... Zylum had the right solution, use the search button Smile

Author:  Tony [ Wed Nov 30, 2005 10:05 am ]
Post subject: 

fire581 - start by going through Turing Walkthrough.. you need to learn the basics before diving into algorythms

MysticVegeta - keep recursion away from fire581 Laughing

Author:  ZeroPaladn [ Wed Nov 30, 2005 10:18 am ]
Post subject: 

fire581 wrote:
u didnt answer my question, and im only in grd.7 and turing is new to me and i made a big mistake, taking advanced course....but probably a bigger mistake was asking you lot



fire581 wrote:
btw that last post was meant to go to the moderator person, not the person who actually offered help


not the best thing to say when your asking for help, hmm? Naughty


: