GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Mar-2006, 05:01
philae philae is offline
New Member
 
Join Date: Mar 2006
Posts: 1
philae is on a distinguished road

urgent help!!arrays-float+double


hi everyone!!i have a homework and i dunno what to do...
we are supposed to write a code in c that inputs two integers 1 to 250 digits and output their
multipication, but th thing is we're not allowed to use words "float" and "double" in our codes!!! in worksheet it says "you need not to use two dimensional arrays" as a hint.i think we're supposed to use arrays...so could you give me a hand??at least an idea???
  #2  
Old 02-Mar-2006, 06:52
davis
 
Posts: n/a

Re: urgent help!!arrays-float+double


Quote:
Originally Posted by philae
hi everyone!!i have a homework and i dunno what to do...
we are supposed to write a code in c that inputs two integers 1 to 250 digits and output their
multipication, but th thing is we're not allowed to use words "float" and "double" in our codes!!! in worksheet it says "you need not to use two dimensional arrays" as a hint.i think we're supposed to use arrays...so could you give me a hand??at least an idea???

Why would you need float or double in integer multiplication?

I guess that it is "urgent" that you read the guidelines for posting help requests.

...this post looks remarkably similar to several others of the same ilk all from different user names who post one question and never return. Are you screwing around with us or is this a sincere user request?

--never any code
--always urgent/in a hurry
--never capitalizes "i" and other parts of sentences
--overuses punctuation
--runs words in sentences together

I think we're being "had" by some prankster.


:davis:
  #3  
Old 02-Mar-2006, 11:21
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,258
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: urgent help!!arrays-float+double


Quote:
Originally Posted by philae
hi everyone!!i have a homework and i dunno what to do...
we are supposed to write a code in c that inputs two integers 1 to 250 digits and output their
multipication, but th thing is we're not allowed to use words "float" and "double" in our codes!!! in worksheet it says "you need not to use two dimensional arrays" as a hint.i think we're supposed to use arrays...so could you give me a hand??at least an idea???
Do you really mean 250 digits in the integer?

If so, set up three arrays of at least 250 integers. Input your integers one digit per array element.

You take it from there, and please read the Guidelines, especially #1, #2, #5, #9
__________________

Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
  #4  
Old 02-Mar-2006, 14:44
davis
 
Posts: n/a

Re: urgent help!!arrays-float+double


Quote:
Originally Posted by WaltP
Do you really mean 250 digits in the integer?

If so, set up three arrays of at least 250 integers. Input your integers one digit per array element.

You take it from there, and please read www.gidforums.com, especially #1, #2, #5, #9

It seems like you're assuming that the total digits of the two numbers multiplied together won't exceed 250 digits...by your "three" arrays of at least 250 integers each. That is, if the third array is to be used for the "result" digits.

If we were to "scale down" the requirement to a maximum of two digits per operand, and we had input of: 10 x 10, the output array very likely needs to be a bit larger than the int[2], yes?

If you were to implement such a solution using int arrays: digits_1[2], digits_2[2] and result[2]...the above example would wipe out your storage because each digit of the answer (100) could not be held in the 2 elements of the array. In fact, if the two sets of two digits were 99 x 99 wouldn't the appropriate answer be 9801...thus requiring 4 digits to be held in the output array?

If you had another plan for the third array of at least 250 integers, what was it to be used for? I definitely don't want to stiffle your creativity, so if you're really just brainstorming and kicking ideas around, that's fine. Just say so. It sounds a bit more like you're offering a partial solution based on using the three integer arrays. Maybe you can describe more fully the plan for them? Naturally, I'm interested in seeing your (everyone's!) method of solving this problem.



:davis:
  #5  
Old 02-Mar-2006, 20:59
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,258
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: urgent help!!arrays-float+double


Up until recently, we've pointed to solutions, not given them full working code. It allows them to think a little on their own, and do most of the solution themselves. Since we don't get the grade for their project, the incentive for us is to help them solve it, not give them the solution.

And at least seems to cover your objection perfectly. He might need more than 250
__________________

Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
  #6  
Old 02-Mar-2006, 23:30
davis
 
Posts: n/a

Re: urgent help!!arrays-float+double


Quote:
Originally Posted by WaltP
And at least seems to cover your objection perfectly. He might need more than 250

No objection from me WaltP...and I have no idea where you even got such a notion that I was objecting to your reply. However, I don't think that the word "perfectly" applies here.

You seem to be saying that the third array must be at least 250 integers. However, I thought that I pointed out that an entry of 99 x 99 would only require a maximum of 4 digits...assuming, of course, that the result was stored in the third array a digit per. What plan did you have for the other 246 ints that you say are the least number necessary? And what of 1 x 0 entered? or -1 x -1?


:davis:
  #7  
Old 03-Mar-2006, 10:12
davis
 
Posts: n/a

Re: urgent help!!arrays-float+double


Quote:
Originally Posted by WaltP
Up until recently, we've pointed to solutions, not given them full working code. It allows them to think a little on their own, and do most of the solution themselves. Since we don't get the grade for their project, the incentive for us is to help them solve it, not give them the solution.

WaltP, you present this "us" and "them" and "we" thing in such a way that I wanted to comment in a more suitable www.gidforums.com. I invite your comments.


:davis:
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Canny edge detector Skm Java Forum 1 01-Jan-2006 07:51
Powell Method EngineerFORhire C Programming Language 5 01-Oct-2005 01:34
Double output leanieleanz C++ Forum 1 11-Mar-2005 21:19

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:39.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.