# program in javascript

## Recommended Posts

If I wonder If I can ask you solution of this program I beginer learning in javascript please could you help me to write this programto allow you to enter the quarterly income of your organization for the entire year.find average yearly income and the total yearly income.from the total yearly income calculate the tax at %15 of the total income.use control strucures the requirement :income for qaurter1:150000income for qaurter2:250000income for qaurter3:175000income for qaurter4:125000total income:700000average income:175000tax:105000net income:595000please I need your help, I'm feeling sick! Thanks for help me

##### Share on other sites

This sounds like you've been given it as a project to do, do you have anything to start it with (we're not just going to write the whole thing for you). A form with all the information in, and where you've got to?

##### Share on other sites

<html><head><title><title><script language="javascript">var income;var netincome;var incometax;var average;total income; income=(); netincome=(); incometa=(); average=total income=document.write("Income Tax = " + IncomeTax + "<BR>");document.write("Net Income = " + NetIncome + "<BR>");</script></head></html>please help me I wonder If you complete this program I want to learn my professor don't want help me I need this program first of all to learn PLEASE I don't know How calculate this problem It is hard

##### Share on other sites

Well, you know what the income for each quarter is, so:var income = new Array( 150000 , 250000 , 175000 , 125000 );for each quarter, as above. So income[0] is 150000 , income[1] is 250000, income[2] is 175000 and income[3] is 125000.So:var totalIncome = 0;for(i=0;i<income.length;i++){ totalIncome += income}will give you the total.var tax = (totalIncome / 100) * 15will give you the taxvar average = totalIncome / 4is the average. etc. I'll leave you work out net, and write the end result into a good looking document.

##### Share on other sites

Thanks very much my friend