Hello again. I've been asking about Java 2 times before, here, and once agian, I am stuck on what to do.
Our task is to draw a circle using the parametric equation, and I don't even know where to begin on this task. Could anyone tell me? :d
As it's obviously a question in Java programming, have you asked the same question at Stack Overflow? Also, did you check your programming references (assuming that you have a book or two on Java)?
Oh my god. I didn't even consider that. <_>
Thanks for reminding me lol, I'll look it through.
Your assignment is probably intended for you to familiarize on how to do some UI under awt/swing.
You probably want to find a range to display, then calculate the value for every pixel along the x axis (remember pixel, not along a discrete integer scale). Draw a line from (x,y) to (x,y) in order to make a dot appear (unless they added more to the API, I don't recall being able to paint a single point).
The most difficult part of the assignment is probabl
1) figuring out how to draw things (check out the graphics2d examples in something like this: http://docs.oracle.com/javase/tutori...iew/index.html
2) Figuring out which points to display.
3) if you have to, parse out the polynomial input from a string.
I assume you had some basic introduction to software development...
How to plan and design and architecture (well, thinking about architecture for something that trivial is certainly not required :heh:)
Anyway. You start with the assessment of what tools are available to you. The capabilities of the framework and so on.
Then you have two possibilities
1) You go for a quick and dirty hack that will satisfy the requirements.
2) Or you really try to write clean code, which will require refactoring and the abiding of several coding rules and best practices.
Since you are not too familiar with software development yet, you will certainly take the route 1).
Actually since this task is so common that even I remember it being part of my assignments in my studies 7 years ago, you can just copy and paste a nice example from the many sites that feature it (for example):
Then you need to manipulate uh customize it a little bit (use your own formatting and names). And you might need to add an algorithm... voila you got your assignment done but learned little in the process (which is the point of such assignments - I am serious btw.)
I dont know if you will need it, but the best way to learn, read, understand and write code is by trying to read and understand lots and lots of cleanly written code (cleanly because you don't want to absorb nasty coding habits right at the beginning).
And then you go and try to realize a little project of your own. Your affinity to the project will give the neccessary patience to endure the many hurdles you will face. But for practicing coding it will most perfect. After several little projects you can start to refine your coding (use of patterns, coding rules, best practices... ).
|All times are GMT -5. The time now is 09:18.|
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.