need help with tax calculator

jaywarren

New member
Joined
Nov 5, 2012
Messages
3
Programming Experience
Beginner
need help with this, I am to wright the code for this calculator. I am new to VB and not sure how to do this, up till now the code was given to me. I am lost as how to make this work. any help would be great.


¾ Required:
¾ Hot key/Short cut keys on buttons
¾ Right-justify all numbers
¾ Declare the constants as class level constants – for County and State tax rates
¾ Format Sales with 2 decimal places
¾ Format all tax answers with dollars/cents
¾ Form Load event –
a. Load 0’s in the sales textboxes and the tax labels answers, set focus
¾ Clear event –
a. Load 0’s in the sales textboxes and the tax labels answers, set focus
¾ In the Calculate Click event
a. Use try/catch logic to catch garbage data being entered
i. If bad data – display a MessageBox, 0’out all tax labels, set focus back to the sales amount
ii. If data is ok –
1. Calculate the county taxes
2. Calculate the state taxes
3. Calculate the total sales taxes
4. Display all calculated amounts with dollars/cents

Thanks




test.png
 
No one will do your homework for you. Prepare the form and double-click the Calculate button to open an event. Then start writing your code. Post the code you have here and ask specific questions about which part of it doesn't work.

You need to get the user's input from the textbox. Calculate the results to display in each of the labels. Then output the results to the labels.
 
I understand that, I am just lost with this class. The first two I did I had the code given to me. This is the first time I need to come up with the code. But I don't understand how to do the math for this one much less how to code it right. I did build the labels and buttons. I did write the code that I knew, but that is very little. I am in a on line class and unable to get any help from any teacher. I have looked all over the net for how to layout the code for this type of calculater with no luck. I am very lost with VB.
 
I understand that, I am just lost with this class. The first two I did I had the code given to me. This is the first time I need to come up with the code. But I don't understand how to do the math for this one much less how to code it right. I did build the labels and buttons. I did write the code that I knew, but that is very little. I am in a on line class and unable to get any help from any teacher. I have looked all over the net for how to layout the code for this type of calculater with no luck. I am very lost with VB.
As Solitaire has already mentioned, we don't condone doing homework for people but we are here to help too.

The first thing that needs to happen here is you need to post the code that you do have so we can help you from there, the image does help with knowing what controls you have on the form, but that does nothing for what code you actually have.
You say that you've had all previous homework code already done for you & I'm willing to bet that in that code there's examples of declaring variables of various types & how to get input from controls on the form. I'm sure with some minor deductive reasoning (and maybe some Google searches) you'll be able to pull enough of an idea together to attempt the code for this simple math here.
 
Yes, the first two I did do relate some to this one. The part that I dont understand is how do I write the code to calculate two different taxes? And then to tell me the total sales tax? I would put the code that I have so far but I can only do the work at my school lab. I do not have VB at home. Thanks for your help, just knowing I have someone to ask for help takes a lot of stress off. I have been stuck on this all day.
 
in the Click event of the "Calculate Sales Tax" button you have to do three things.

1.) lblCounty = txtAmount * (whatever that rate is)
2.) lblStat = txtAmount * (whatever that rate is)
3.) Subtract 1 and 2 from amount entered and put into lblTotal (or whaever you called it).

Three lines of code will make this app work. Make sure you convert the text value to a decimal multiply it then convert them back to strings to display.
 
Programming is about problem solving. It requires thought and reasoning. You need to look at each line of code carefully and fully understand what it does. You say you were given the code for previous projects. Did you study the code? Did you understand what each line was supposed to do?

I suggest you look over those assignments carefully and attempt to write the code yourself, without looking at the code you were given. That should give you a clue on how to start, and where you still need to fill in the gaps. This is probably what you should have done in the first place, as you were expected to understand the concepts and know exactly what needed to be done. Following the past examples and giving it some thought should have allowed you to use those concepts to create a project on your own and be able to solve related programming problems.

As far as calculating the tax and finding the totals, this is 6th grade arithmetic. High school and college students are expected to know those elementary equations.

I also suggest you install Visual Basic Express on your home computer. Download it from Microsoft. It's absolutely free.

Good luck.
 
Back
Top