# Need Help Writing Program to Solve Math Problem

Page 1 of 1

## 5 Replies - 1351 Views - Last Post: 26 June 2015 - 09:36 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=377968&amp;s=6f0cc045e45f81190c604251d157760f&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 brendon146

Reputation: 0
• 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

• Suitor #2

Reputation: 15559
• 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/

### #3 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 12688
• 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.

### #4 brendon146

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

## Re: Need Help Writing Program to Solve Math Problem

Posted 26 June 2015 - 09:31 AM

macosxnerd101, 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.

### #5 modi123_1

• Suitor #2

Reputation: 15559
• 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.

### #6 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 12688
• 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.