Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calculating widget costs

 
Marcel Goulart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a homework assignment and I have to create a GUI that calculates the cost of an imaginary widget at a user specified price the only things that dont change is the percentage of tax(7.5%) and shipping costs(which is $9.95).
I am having an issue with the text fields doing the arithmetic and then displaying it.

Here is my code so far.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marcel,
Welcome to the Ranch!

You have mentioned you have an issue. What is it? Are you getting errors/exceptions when running the code? You need to provide us more details about the problem.
I see that you are getting the values from the textfield and converting it to the data type. I think you should proceed with writing the calculation code.
 
Marcel Goulart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the welcome Ranganathan, I figured it out last night. I had a couple things in the wrong spot. I'll upload the correct code.

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. So, is it all working ok now? do you need anymore help?
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcel Goulart wrote:Thank you for the welcome Ranganathan, I figured it out last night. I had a couple things in the wrong spot. I'll upload the correct code.
. . .
Well done sorting it out , but that code needs a lot of editing if you want lots of marks. Get rid of all the tabs and excess blank lines, and make sure all code inside {} lines up vertically. We have some suggestions about formatting, which you might do well to look at.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic