•
•
•
•
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
![]() |
•
•
Join Date: Apr 2007
Location: US
Posts: 21
Reputation:
Rep Power: 2
Solved Threads: 0
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.
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)
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)
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
----------------------------------------------
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Weird ASP/SQL Problem (ASP)
- binary to decimal problem (C++)
- binary integer logic (Software Developers' Lounge)
- Exercise using: unsigned int datecode(int year, int month, int day); (C++)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- Reversing Integer, Magic Squares, and LCM problems (Java)
- Weird IE6 printing problem... (Web Browsers)
Other Threads in the Java Forum
- Previous Thread: C programmers guide to Java
- Next Thread: StringUtil



. (I do understand why its important to do it the other way though)
Linear Mode