User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 455,962 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,602 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 2321 | Replies: 22 | Solved
Reply
Join Date: Apr 2007
Location: US
Posts: 21
Reputation: rpk5000 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rpk5000 rpk5000 is offline Offline
Newbie Poster

Re: Weird Binary to Integer Problem

  #21  
Nov 19th, 2007
Let me start by saying that the code I have given here (post 3 i think) is an acceptable solution to the problem.

Yes it was obvious I needed to take into the program a number and convert it into an array.
I didn't want any help writing any of the code at all, when people give code the person seeking help doesn't learn anything. I'd much rather write it myself and go through the sun documentation.

What I didn't get was why you would want to convert the input to a boolean array ever. Mathematically it seems much easier to do it the way i did, with an array of integers. When I emailed him he said that I could do it that way.

My only issue was why would you want to do the extra work of converting it into booleans and back. I have problems doing things in a stupid way, earlier in this same assignment he had us create a new instance just to store the data.
class MusicDisc {
public String title, artist;
public int year;
}; 

I asked him why and he said that you couldn't return more than one piece of data at a time, my response was to use toString and put it all in there instead of making a new instance. (I like efficiency over OOP)
Reply With Quote  
Join Date: Feb 2006
Posts: 1,508
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: Weird Binary to Integer Problem

  #22  
Nov 19th, 2007
To tell you the truth, that may seem efficient, however, once returned, the rest of th program must then "parse" that String to extract the info (it won't necessarilly only be used for output), whereas that object will allow the rest of the program to directly access the data without having to parse it first.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Apr 2007
Location: US
Posts: 21
Reputation: rpk5000 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rpk5000 rpk5000 is offline Offline
Newbie Poster

Re: Weird Binary to Integer Problem

  #23  
Nov 19th, 2007
Oh, sorry, I meant efficient as I have other stuff to do and I need to get this assignment done first . (I do understand why its important to do it the other way though)
Last edited by rpk5000 : Nov 19th, 2007 at 12:39 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 9:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC