
-----------------------------------
fire581
Tue Nov 29, 2005 4:11 pm

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

-----------------------------------
Albrecd
Tue Nov 29, 2005 4:16 pm


-----------------------------------
Asok said:
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

-----------------------------------
person
Tue Nov 29, 2005 4:20 pm


-----------------------------------
ask us a question and we'll help, ask us to do ur hwk, and u'll ge flamed[/quote]

-----------------------------------
fire581
Tue Nov 29, 2005 4:26 pm


-----------------------------------
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

-----------------------------------
fire581
Tue Nov 29, 2005 4:39 pm


-----------------------------------
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

-----------------------------------
Tony
Tue Nov 29, 2005 4:44 pm


-----------------------------------
such as learning how to program perhaps?

-----------------------------------
Albrecd
Tue Nov 29, 2005 4:46 pm


-----------------------------------
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.

-----------------------------------
fire581
Tue Nov 29, 2005 4:49 pm


-----------------------------------
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
Tue Nov 29, 2005 4:50 pm


-----------------------------------
btw that last post was meant to go to the moderator person, not the person who actually offered help

-----------------------------------
Tony
Tue Nov 29, 2005 4:53 pm


-----------------------------------
[url=http://www.compsci.ca/v2/viewtopic.php?t=8443&highlight=prime+factors]primes?
[url=http://www.compsci.ca/v2/viewtopic.php?t=6156&highlight=prime+factors]factors?

it's all there :wink:

-----------------------------------
Albrecd
Tue Nov 29, 2005 4:56 pm


-----------------------------------
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)

-----------------------------------
fire581
Tue Nov 29, 2005 5:54 pm


-----------------------------------
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

-----------------------------------
MysticVegeta
Tue Nov 29, 2005 6:46 pm


-----------------------------------
Isnt there a post that I posted with Prime factors using recursion... Zylum had the right solution, use the search button  :)

-----------------------------------
Tony
Wed Nov 30, 2005 10:05 am


-----------------------------------
fire581 - start by going through Turing Walkthrough.. you need to learn the basics before diving into algorythms

MysticVegeta - keep recursion away from fire581 :lol:

-----------------------------------
ZeroPaladn
Wed Nov 30, 2005 10:18 am


-----------------------------------
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


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:
