Results 21 to 24 of 24
 05302013, 08:43 AM #21
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,003
 Blog Entries
 7
 Rep Power
 20
Re: Fractions
Tip: there's a nice, and quite old, concept "Egoless Programming" (Jerry Weinberg invented it); basically it says this: be rough for the code, be nice to the programmer; and that's what Kevin did. More bluntly: you should grow a thicker skin if you want to cooperate with, or ask advice from other programmers; they're just being rough to your code; don't mix it up with your ego. Here's a link: Egoless programming  Wikipedia, the free encyclopedia
kind regards,
Joscenosillicaphobia: the fear for an empty beer glass
 05302013, 03:20 PM #22
Re: Fractions
Sorry, but that's not quite correct. With my example of pi, or things like the square root of two, or indeed any other irrational number, narrowing it down to a fraction is by definition impossible. You didn't specify any limitations on the numbers your users can input your example code uses command line input, but maybe the actual program can take things like sqrt(2) or pi, or maybe you're using a gui to get input that allows irrational numbers. All I was trying to help you understand was that any approach you take will be making assumptions on the user input. As helpers, we shouldn't make those assumptions for you, but should help you tease them out on your own. Not sure why that was met with such hostility.
Again, I disagree. You made several statements that showed a fundamental lack of understanding of the concepts involved in this assignment and that's absolutely okay, I was just trying to help you work through them. IMHO, I think Richard did you a disservice (no offense Richard) by giving you the approach like that the whole point of this assignment was to work on your problem solving skills, and although Richard didn't just spoonfeed you the answer, I also think you missed out on the process of working through a problem on your own, which again, is what I was trying to help you do. Teaching somebody to code a given algorithm is pretty easy. Teaching somebody to come up with an algorithm in the first place is the hard part, and I think that's the actual point of the assignment, which you've now missed out on.
You're going to find that attitudes like the one you've taken in this post will not get you very far in the programming world. I was simply trying to walk you through a train of thought, and instead you whined the whole time about just wanting the approach handed to you, which as I've said above was probably the whole point of the assignment. You are now worse off than your classmates who worked through the process of coming up with an algorithm on their own. You might have the syntax, but that's the easy part. The problemsolving process is what really makes a good programmer, and you cheated yourself out of that by ignoring my questions. Oh well, the type of programmer you're interested in becoming is up to you.How to Ask Questions the Smart Way
Static Void Games  Play indie games, learn from game tutorials and source code, upload your own games!
 05302013, 04:00 PM #23Member
 Join Date
 May 2013
 Posts
 20
 Rep Power
 0
Re: Fractions
Stop, just stop. It doesn't need to be perfect. 99% of people will not have pi for a variable.
You have no idea what the point of this assignment was. Here was the actual point, from the assigner: "I didn't expect people to get it right. I wanted to see what they would do."
I missed out on nothing. I went from having zero knowledge on a topic, to learning a method, and then figuring it out myself. Richard did me a favor.
Now, will you please just drop it? I came here to learn, all you're doing is arguing with me over fractions and how I should learn.
I won't be responding anymore, you just don't seem to understand.
 05302013, 04:12 PM #24
Re: Fractions
Cool, and that's great to know. But it's not an assumption we can just make without knowing more about your context for plenty of users, not accurately supporting irrational numbers would be a big deal. My only point, which still stands, is that any approach you take will work off of assumptions like this one. From your first post, I think that's a perfectly valid reply. You could have then replied with "okay, good to know, what do you think about this approach", but instead you argued that irrational numbers don't exist and whined about not being handed an algorithm. You might want to rethink your approach.
That pretty much proves my point, doesn't it? The goal of the assignment was not to get an algorithm from the internet and implement it it was to come up with the algorithm yourself. I could see your instructor asking the class "how did you come up with your approach?" and who is going to have learned more the person who says "well I thought about it this way, then tried this, but then thought about it this way instead" or you, who must now say "umm, I got it from the internet."
I understand perfectly, I'm just trying to help you understand the "meta lesson" involved in programming assignments the whole point of most of them is not to get the syntax right, but to think through the problem. Most people here are going to try to get you to think through a problem instead of just giving you code or even an algorithm. I highly suggest you learn how to react to that type of advice instead of whining and bickering, but it's really up to you.
Much luck.How to Ask Questions the Smart Way
Static Void Games  Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads

How to reduce fractions in Java?
By uselessparadigm in forum New To JavaReplies: 9Last Post: 04092012, 08:02 PM 
trouble using fractions
By jeanOliver in forum New To JavaReplies: 2Last Post: 09062011, 08:48 PM 
Reducing fractions
By SwEeTAcTioN in forum New To JavaReplies: 10Last Post: 01132010, 04:51 PM 
NumberFormat which leave fractions as they are
By itaipee in forum AWT / SwingReplies: 2Last Post: 12092009, 06:11 PM 
How do I reduce Fractions in this program?
By Popedreadlock in forum New To JavaReplies: 8Last Post: 12082008, 12:28 AM
Bookmarks