need suggestion on a program

kevinf

Limp Gawd
Joined
Feb 21, 2004
Messages
375
i am trying to create a math program but need suggestion on what kind. it has to be java and the only requirement i need is that it needs to use java. don't suggest me anything too complicated, because i have only learned up to arrays. i am thinking about having the user input 2 points and have the program calculate the slope. i am also planning on having it calculate the slope intercept form from a point and a slope. would this be good. suggestions are all welcome as longa s nothing too complicated. no applets either
 
Command line only? Why not make a full featured calculator like the ones that comes with windows.
 
I think your idea is pretty good. Start from there and keep adding more trig/geometery functions.
 
what do you mean, i was originally only going with linear equations not really trigonometric, but i would try it out if you explain more
 
Well since it's command line based, try to make a display, have the user select an action such as

Code:
Select an action:
1 - Basic Calculator
2 - Slope and Intercept
3 - Trajectory

Once they chose let's say basic calculator

Code:
Trajectory
Enter Mass:
Enter Speed:
Enter Velocity:

I doubt that's what you need to find trajectory, just giving example.
 
GaryS128 said:
Well since it's command line based, try to make a display, have the user select an action such as

Code:
Select an action:
1 - Basic Calculator
2 - Slope and Intercept
3 - Trajectory

Once they chose let's say basic calculator

Code:
Trajectory
Enter Mass:
Enter Speed:
Enter Velocity:
I doubt that's what you need to find trajectory, just giving example.
no doubt! i'm no physics man, but i think angle goes in there somewhere, too!
;)

to the OP, you could use loops to find factorials.
 
so you guys are suggesting that i build a multipurpose calculator. should i have a separate cclass for each different type of operation
 
How about a math program that can integrate any function up to triple integrals?
 
Taken any chemistry or physics classes lately? In high school I always found it helpful to program all the formulas we learned so that I could do the tedious homework sets quickly. Not only did this make doing the homeworks very easy but also helped me remember the formulas for the tests.

Try to make it so that the user can enter all but one of the required variables and the program automatically solves for the unknown.
IE) E=MC^2, a user could enter E and C which would cause M to be calculated and displayed. Or alternatively, enter M and C, which would display the value of E.

The great thing about chemistry and physics is that there are hundreds of these equations dealing with 3-5 variables and nothing more complicated than powers and trigonometry.
 
[H]exx said:
How about solving prime numbers :p ... JK...thats the typical problem done in Java/Programming classes...
What does "solving a prime number" mean?


kevinf said:
should i have a separate cclass for each different type of operation
No.
 
I don't know yet. What will the program do, and how will the user interact with it? What are your goals? Do you just want to use classes, even if your use of classes isn't natrual?
 
mikeblas said:
What does "solving a prime number" mean?
I was wondering about this as well. I can guess it is finding the prime factors of a specified number, or finding the first n prime numbers.
 
well i am going to have a list of commands that the user can do by pressing the specify number and the task of the program is to do calculations depending on what the user wants to calculate
 
jimmyb said:
I was wondering about this as well. I can guess it is finding the prime factors of a specified number, or finding the first n prime numbers.
I guessed that, too; but a number that has non-trivial factors isn't a prime number. That would just be "factoring a number".
 
It's really hard to help you design your program when we know so little about what you want it to do, or how you want it to be done. Is it a GUI or a command-line program, for example?

Do you just want to use classes, even if your use of classes isn't natrual?

What kinds of specific things will the user want to "calculate"? Just mathematical operators, like addition, subtraction, multiplicaiton, and division? Or more complicated calculations with multiple parameters, like the slope calculation you were talking about before? What other things?

I'm guessing that English isn't your first languge, so I can understand that it might not be easy for you to communicate the idea. But the more information you can give us, the better we can help.
 
ya, i already stated that it is going to be command line based, it is basically going to let the user calculate simple operations and i might add in a few complex operations. when i am talking about classes i mean that i want my own methods in the program and my own objects
 
I guess I'm not making myself clear. How you'll add classes depends on your design. We can't tell you what classes you need or how you'll make them until you get very (very!) specific about your design.

Will you take algebraic input, or just offer menus? What are the operations you'll support, very specifically, as a complete list?
 
i am going to have a multipurpose calculator. it will offer a menu listing the things that it can do. the menu is going to include simple add, subtract, muliiply, divide operation, an operation that deals with slope intercept equation, slope equation, etc. a operation that does calulates area circumference and perimeter of various types of shapes, and possibly some trigonometric equation solvers. hope that is specific enough
 
i'd say the menu and menu logic would be inside of the class in which main() resides. the functions, like add or whatever, could be public static methods within some seperate class like "MyMath".

the menu doesnt really seam reusable in any way, so i dont think it makes much sense to make it a seperate class unless you do something fancy like create a menu object that can be modified to display different types of menu's with arbitrary inputs that can be mapped to arbitrary methods.
 
so i should put the menu in the main class and all the math operations in the classes?
 
kevinf said:
i am going to have a multipurpose calculator. it will offer a menu listing the things that it can do. the menu is going to include simple add, subtract, muliiply, divide operation, an operation that deals with slope intercept equation, slope equation, etc. a operation that does calulates area circumference and perimeter of various types of shapes, and possibly some trigonometric equation solvers. hope that is specific enough
should i have separate classes for each operation for this case
 
Back
Top