Results 1 to 5 of 5
- 10-09-2013, 06:34 AM #1
Member
- Join Date
- Oct 2013
- Posts
- 63
- Rep Power
- 0
Please help me with this project?
Hello, I am trying to make a simple calculator.
I am very new to Java (I started learning around 3 days ago) so bear with me and my lack of knowledge. Sorry and thank you for any help you can provide!
Basically, what I want it to do is when it starts up, it'll greet the user and ask which of the following six functions they want to perform:
addition, subtraction, multiplication, division, exponentiation and square root. Then it should ask about the appropriate number of operands for the function (the user will input a number)
Then it should print the calculation that will be performed, perform it, then print the result.
I am not sure how to accomplish the user input aspect. Do I use "if" statements? I am not sure.
I am really just unsure on how to do all of this.
- 10-09-2013, 07:03 AM #2
Re: Please help me with this project?
Using an if statement (else if) would be a good start.
- 10-09-2013, 12:08 PM #3
Member
- Join Date
- Oct 2013
- Posts
- 63
- Rep Power
- 0
Re: Please help me with this project?
Okay, I've worked out how to do the basic operations.
The thing which I'm stuck on is how to get negative numbers to work correctly for the square root operator.
Also, I don't really know how to get the program to perform more than one calculation without restarting the program. Do you know how I might accomplish this?
- 10-09-2013, 03:25 PM #4
Member
- Join Date
- Jun 2013
- Posts
- 60
- Rep Power
- 0
Re: Please help me with this project?
Perhaps put the entire program in a while loop and ask if the user wishes to exit. (Y,N)
- 10-09-2013, 05:28 PM #5
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 13
Re: Please help me with this project?
The JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
Similar Threads
-
how to convert a java project into a javafx project?
By such orb in forum NetBeansReplies: 7Last Post: 11-27-2012, 11:16 AM -
How to transform a regular project to an EJB project?
By eildosa in forum EclipseReplies: 1Last Post: 05-17-2012, 10:43 PM -
Creating a project in eclipse from existing project
By Suraiya in forum New To JavaReplies: 1Last Post: 10-08-2011, 10:14 AM -
open existing project project ..
By itaipee in forum EclipseReplies: 1Last Post: 12-28-2008, 09:12 PM
Bookmarks