Mã: <html> <head> <title> Nghiep Huynh CSCI 1101-90 Lab8 </title> </head> <body onunload="alert('Enjoy your summer!');"> <div style="text-align:center"> <h1> <b> SUMMER JOB </b> </h1> </div> <hr/> <h3> <b> <i> You found an exciting summer job for five weeks. It pays $15.50 per hour. Suppose the total tax you pay on your summer job income is 14%. After paying the taxes you spend 10% of your net income to buy new clothes and other accessories for the next school year and 1% to buy school supplies. After buying clothes and school supplies, you use 25% of the remaining money to buy savings bonds. For each dollar you spend to buy savings bonds, your parents spend $0.50 to buy additional savings bonds for you.This tool will help you find out the amount of money that you spend for each type!</i> </b> </h3> <script style="text/javascript"> alert("You should put your work hours per day that is not bigger than 24 and not less than 0!"); var hour, totalhour, totalmoney, aftertax, clothes, school, savingbonds, parentsmoney; hour=prompt("Enter your work hours per day here:",""); hour=parseFloat(hour); totalhour=35*hour; document.write("<p> Your total work hours in summer is: <b> " + totalhour + " hours. </b> </p>"); totalmoney=totalhour*15.5; document.write("<p>Your money before tax is: <b> "+ totalmoney +" dollars. </b> </p>"); aftertax=totalmoney- totalmoney*0.14; document.write("<p>Your money after tax is: <b> "+ aftertax +" dollars.</b> </p>"); clothes=aftertax*0.1; document.write("<p>Money for new clothes and other accessories is: <b> "+ clothes +" dollars.</b> </p>") school=aftertax*0.01; document.write("<p>Money for school supplies is: <b> "+ school +" dollars. </b> </p>"); savingbonds=(aftertax - clothes -school)*0.25; document.write("<p>Money for saving bonds is: <b> "+ savingbonds +" dollars.</b> </p>"); parentsmoney=savingbonds*0.5; document.write("<p>Your parents' money help you to buy additional saving bonds is: <b> "+ parentsmoney +" dollars. </b> </p>"); </script> </body> </html> Chả hiểu làm sao mà khi vận hành nếu cho các số VD 7 9... sẽ có vài số đáp số rất mắc cười ko giống như sử dụng máy tính! Xin cho ý kiến cảm ơn!
Mắc cười là sao? Nó tính sai hay là sao? Đáp số không giống như sử dụng máy tính ?? Là thế nào??? Câu hỏi của bạn mơ hồ làm người đọc bối rối....., bạn phải chỉ ra những chỗ đó chứ nhỉ???
sai cái chổ này nè! Money for new clothes and other accessories is: 326.58500000000004 dollars. làm quái gì mà nó tính râ số 0 nhiều quá! máy tính cầm tay đâu như nó!