Jump to content

program in javascript


alnada266
 Share

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

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...