(Solved) : Write Function Calculates Amount Money Person Would Earn Period Years Salary One Penny Fir Q42694831 . . .

Write a function that calculates the amount of money a personwould earn over a period of years if his or her salary is one pennythe first day, two pennies the second day, and continues to doubleeach day. The program should ask the user for the number of yearsand call the function which will return the total money earned indollars and cents, not pennies. Assume there are 365 days in ayear.

<!DOCTYPE html> <html> <body> <!-- replace the text below with your name! --> <!-- --> <!-- --> <title> TYPE YOUR NAME HERE</

<!DOCTYPE html> <html> <body> <!– replace the text below with your name! –> <!– –> <!– –> <title> TYPE YOUR NAME HERE</title> <script> // Write a function that calculates the amount of money a person would earn over // a period of years if his or her salary is one penny the first day, two pennies // the second day, and continues to double each day. The program should ask the // user for the number of years and call the function which will return the total // money earned in dollars and cents, not pennies. Assume there are 365 days // in a year. function totalEarned (years) {4 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII/ // Insert your code between here and the next comment block. Do not alter // // any code in any other part of this file. MITTITTITTITUTIMITTITITIITTITTITUITTITTIIIIIIIIIIIIIIIIIIIIIII TITTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT // Insert your code between here and the previous comment block. Do not alter // // any code in any other part of this file. I TTTTTTTTTTTTTTTTTTIIIIIIIIIIIIIIIIIIIIIIIIIIIIII M var yearsWorked = parseInt(prompt(‘How many years will you work for pennies a day? ‘)); alert(‘Over a total of ‘ + yearsWorked + ‘, you will have earned $’ + totalEarned (yearsWorked) ); </script> </body> </html> Show transcribed image text TYPE YOUR NAME HERE // Write a function that calculates the amount of money a person would earn over // a period of years if his or her salary is one penny the first day, two pennies // the second day, and continues to double each day. The program should ask the // user for the number of years and call the function which will return the total // money earned in dollars and cents, not pennies. Assume there are 365 days // in a year. function totalEarned (years) {4 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII/ // Insert your code between here and the next comment block. Do not alter // // any code in any other part of this file. MITTITTITTITUTIMITTITITIITTITTITUITTITTIIIIIIIIIIIIIIIIIIIIIII TITTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT // Insert your code between here and the previous comment block. Do not alter // // any code in any other part of this file. I TTTTTTTTTTTTTTTTTTIIIIIIIIIIIIIIIIIIIIIIIIIIIIII M var yearsWorked = parseInt(prompt(‘How many years will you work for pennies a day? ‘)); alert(‘Over a total of ‘ + yearsWorked + ‘, you will have earned $’ + totalEarned (yearsWorked) );

Expert Answer


Answer to Write a function that calculates the amount of money a person would earn over a period of years if his or her salary is …

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?