Hi I am a complete newbie so please go easy on me

I want to create an HTML form for a calculation and I want use javascript to perform the actual calcualtion on a button click. There are two things I want it to do but do not know if it is possible:

1. I want to have a gross annual salary field and a gross weekly field, I also want a net annual and net weekly field. because some people only know what their annual salary is and not there weekly I want it to automatically complete they one they do not fill in. So if someone puts in their gross annual salary I want the gross weekly salary to automatically complete with (gross annual divided by 52). But if they put in their gross weekly I want it to automatically fill in their gross annual (weekly times 52). Is this possible?

2. The second thing I want is that some of the text fields are optional so I want it to say 'do you want to enter x' with a tick box next to it, if it is ticked then I want the relevant text box/number box to appear.

Any help would be greatly appreciated Thank you