5 Replies - 1351 Views - Last Post: 26 June 2015 - 09:36 AM Rate Topic: -----

#1 brendon146   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-June 15

Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:13 AM

I'm definitely a noob when it comes to programming- the most I've ever done was writing little programs to repeatedly pop up text boxes, or shut down people's computers in middle school. I now work for a property management company, and we are setting up a credit card payment system. The service we are using charges 1.69% of every swipe. I have established that the formula R/.9831=C allows me to find the Charge © needed with the required Rent ® given. It is a very simple equation, yet I am trying to streamline the process, and I wish to develop a very simple program that opens a window where there is a text box to type in the desired rent ($750 for example). When you hit enter, it plugs 750 in for R, and then the window shows the answer ©. Can anyone guide me in the right direction here? Thank you very much.

Is This A Good Question/Topic? 0
  • +

Replies To: Need Help Writing Program to Solve Math Problem

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15559
  • View blog
  • Posts: 62,288
  • Joined: 12-June 08

Re: Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:21 AM

There are a plethora of java tutorials regarding GUI apps.
http://www.dreaminco...c-gui-concepts/
http://www.dreaminco...-for-beginners/
http://www.dreaminco...-using-jframes/
http://www.dreaminco...c-gui-concepts/
http://www.dreaminco...torial-in-java/

http://www.dreaminco...ad-application/
Was This Post Helpful? 1
  • +
  • -

#3 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12688
  • View blog
  • Posts: 45,877
  • Joined: 27-December 08

Re: Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:21 AM

Why not just do this in Excel? Seems like it would be easier and streamline the process.

If you're set on doing this in Java, the popup window that would be easiest to use is the JOptionPane. It returns inputs as Strings. If it's a valid double, you can use the Double.parseDouble() method to convert the input to a numeric value. Then apply your formula.
Was This Post Helpful? 0
  • +
  • -

#4 brendon146   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-June 15

Re: Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:31 AM

View Postmacosxnerd101, on 26 June 2015 - 09:21 AM, said:

Why not just do this in Excel? Seems like it would be easier and streamline the process.

If you're set on doing this in Java, the popup window that would be easiest to use is the JOptionPane. It returns inputs as Strings. If it's a valid double, you can use the Double.parseDouble() method to convert the input to a numeric value. Then apply your formula.


The computer in my office runs windows XP, and I have Excel 2000. It's more convenient to make a spreadsheet with a brick and a microwave.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15559
  • View blog
  • Posts: 62,288
  • Joined: 12-June 08

Re: Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:33 AM

Tha.. that doesn't make sense.
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12688
  • View blog
  • Posts: 45,877
  • Joined: 27-December 08

Re: Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:36 AM

You could just use the formula =A1/0.9831 or something similar. Honestly, since you don't have much programming experience, I see the time you'll spend learning and the quality of the product as not streamlining the system. If you don't like Excel, perhaps look for an existing mortgage calculator product. Personally, I never found Excel that bad for spreadsheet work. I wouldn't want to develop an application in it, but I use it frequently for spreadsheet work.

If your goal is to learn programming, that's great. I'm not discouraging you from learning to program. However, I think you're being unrealistic about what you'll accomplish in a reasonable amount of time and how much it will streamline the process. It takes at least a year of solid programming experience (assuming negligible prior experience) before being remotely ready for industry work.

Just some perspective. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1