Unfinished code (Simple payroll) - javascript -


Please help me to solve the formula in "othrs" (overtime hours)
  

code> var name, hour, rate = 120, oterate = 150, Others, BP, OTPE, GPA, DAD, NPA name = prompt ("Enter your name") hrs = prompt (enter "Working hours ") Othrs = bpay = hours * rate ottap = orthurs * ottet GPA = BPA + otpe dead = BPA * .10 NPA = GP - Deep if (HRS and LT; 40) {HRS = 40} alert (" name: "+ + Name + "\ nNo. Hours work: "+ hours +" \ n Not in overtime hours: "+ + + + +" \ n Basic payment: "+ BPA +" \ nOvertime salary: "+ OTPE +" \ nGross pay: "+ gpay +" \ N deduction: "+ Ded +" \ n Net Payment: "+ npay")

< P> Well, because this question is not being closed, I can answer it. See it in action here:

Now, this is not the most effective way of doing this and I will do my code for you I'm not going to reapply, but it's yours The answer is: Hour, rate = 120, ottet = 150, Author, BP, OTP, GPA, DAD, NPA name = prompt ("Enter your name") RRS = Prompt ("Enter Working Hours") othrs = Hours & gt; 40? Hours -40: 0; Bpay = (hours = 40? 40: hours) * Rate OTP = Others * Oterate GPA = BPA + OTPPE = BPA * .10 NPA = GPA - DEER warning ("Name:" + + name + "\ n No hours Work: "+ hours +" \ n Not in overtime hours: "+ + + + + \" \ n Basic payment: "+ BPA +" \ nOvertime pay: "+ OTPE +" \ nGross pay: "+ gpay +" \ nDeduction : "+ Ded +" \ n Net Pay: "+ npay")

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -