{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-08-28T06:28:26-04:00", "answer_date": "2024-08-28 06:28:26", "is_docs_available": null, "is_excel_available": null, "is_pdf_available": null, "count_file_available": 0, "main_page": "student_question_view", "question_id": "8562713", "url": "\/study-help\/questions\/debug-fvjs-for-two-errors-then-upload-only-the-corrected-8562713", "question_creation_date_js": "2024-08-28T06:28:26-04:00", "question_creation_date": "Aug 28, 2024 06:28 AM", "meta_title": "[Solved] debug fv.js for TWO errors; then upload o | SolutionInn", "meta_description": "Answer of - debug fv.js for TWO errors; then upload only the corrected fv.js . Here is a copy of the current fv.css body { font-fa | SolutionInn", "meta_keywords": "debug,fvjs,two,errors,upload,corrected,copy,current,fvcss,body,font-family,arial", "question_title_h1": "debug fv.js for TWO errors; then upload only the corrected fv.js . Here is a copy of the current fv.css body { font-family: Arial, Helvetica,", "question_title": "debug fv.js for TWO errors; then upload only the corrected fv.js .", "question_title_for_js_snippet": "debug fv js for TWO errors then upload only the corrected fv js Here is a copy of the current fv css body font family Arial, Helvetica, sans serif background color white width 600px margin 0 auto padding 0 2em 1em border 3px solid blue h1 color blue margin bottom 25em label float left width 11em text align right input margin left 1em margin bottom 5em margin right 5em width 11em span color red Then the fv js use strict var $ function (id) return document getElementById(id) var calculateFV function(investment, rate, years) var futureValue investment for (var i 1 i 100000) investment nextElementSibling firstChild nodeValue Must be 1 100000 ok false else investment nextElementSibling firstChild nodeValue if (rate value ) rate nextElementSibling firstChild nodeValue Rate is required ok false else if (isNaN(parseFloat(rate value))) rate nextElementSibling firstChild nodeValue Must be numeric ok false else if (rate value 1 rate value 15) rate nextElementSibling firstChild nodeValue Must be 1 15 ok false else rate nextElementSibling firstChild nodeValue if (years value ) years nextElementSibling firstChild nodeValue Years is required ok false else if (isNaN(parseInt(years value))) years nextElementSibling firstChild nodeValue Must be integer ok false else if (years value 1 years value 50) years nextElementSibling firstChild nodeValue Must be 1 50 ok false else years nextElementSibling firstChild nodeValue if (ok) $( future value ) value calculateFV(parseFloat(investment), parseFloat(rate), parseInt(years)) else $( future value ) value window onload function () $( calculate ) onclick processentries $( investment ) focus() then lastly the index html Future Value Calculator Future Value Calculator Total Investment Annual Interest Rate Number of Years Future Value Please help ", "question_description": "

debug fv.js for TWO errors; then upload only the corrected fv.js<\/strong>.<\/p>

Here is a copy of the current fv.css<\/p>

body { font-family: Arial, Helvetica, sans-serif; background-color: white; width: 600px; margin: 0 auto; padding: 0 2em 1em; border: 3px solid blue; } h1 { color: blue; margin-bottom: .25em; } label { float: left; width: 11em; text-align: right; } input { margin-left: 1em; margin-bottom: .5em; margin-right: .5em; width: 11em; } span { color: red; }<\/p>

<\/p>

Then the fv.js<\/p>

\"use strict\"; var $ = function (id) { return document.getElementById(id); } var calculateFV = function(investment, rate, years) { var futureValue = investment; for (var i = 1; i <= years; i++ ) { futureValue += futureValue * rate \/ 100; } futureValue = futureValue.toFixed(2); return futureValue; } var processEntries = function() { var investment = $(\"investment\"); var rate = $(\"annual_rate\"); var years = $(\"years\"); var ok = true; if (investment.value == \"\") { investment.nextElementSibling.firstChild.nodeValue = \"Principal Investment is required.\"; ok = false; } else if (isNaN(parseFloat(investment.value))) { investment.nextElementSibling.firstChild.nodeValue = \"Must be numeric.\"; ok = false; } else if (investment.value<1 || investment.value>100000) { investment.nextElementSibling.firstChild.nodeValue = \"Must be 1..100000.\"; ok = false; } else { investment.nextElementSibling.firstChild.nodeValue = \"\"; } if (rate.value == \"\") { rate.nextElementSibling.firstChild.nodeValue = \"Rate is required.\"; ok = false; } else if (isNaN(parseFloat(rate.value))) { rate.nextElementSibling.firstChild.nodeValue = \"Must be numeric.\"; ok = false; } else if (rate.value<1 || rate.value>15) { rate.nextElementSibling.firstChild.nodeValue = \"Must be 1..15.\"; ok = false; } else { rate.nextElementSibling.firstChild.nodeValue = \"\"; } if (years.value == \"\") { years.nextElementSibling.firstChild.nodeValue = \"Years is required.\"; ok = false; } else if (isNaN(parseInt(years.value))) { years.nextElementSibling.firstChild.nodeValue = \"Must be integer.\"; ok = false; } else if (years.value<1 || years.value>50) { years.nextElementSibling.firstChild.nodeValue = \"Must be 1..50.\"; ok = false; } else { years.nextElementSibling.firstChild.nodeValue = \"\"; } if (ok) { $(\"future_value\").value = calculateFV(parseFloat(investment), parseFloat(rate), parseInt(years)); } else { $(\"future_value\").value = \"\"; } } window.onload = function () { $(\"calculate\").onclick = processentries; $(\"investment\").focus(); }<\/pre> 

<\/p>

then lastly the index.html<\/p>

<\/p>

Future Value Calculator<\/title> <link rel=\"stylesheet\" href=\"http:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.2.0\/css\/bootstrap.min.css\"> <link rel=\"stylesheet\" href=\"fv.css\"> <script src=\"http:\/\/code.jquery.com\/jquery-1.11.1.min.js\"><\/script> <script src=\"http:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.2.0\/js\/bootstrap.min.js\"><\/script> <script src=\"fv.js\"><\/script> <\/head> <body> <main> <h1>Future Value Calculator<\/h1> <label for=\"investment\">Total Investment:<\/label> <input type=\"text\" id=\"investment\"> <span>*<\/span> <\/p> <p> <label for=\"rate\">Annual Interest Rate:<\/label> <input type=\"text\" id=\"annual_rate\"> <span>*<\/span> <label for=\"years\">Number of Years:<\/label> <input type=\"text\" id=\"years\"> <span>*<\/span> <label for=\"future_value\">Future Value:<\/label> <input type=\"text\" id=\"future_value\" disabled> <!-- Aparently this only works when using form-groups.. --> <div> <div id=\"placeForAlert\"><\/div> <\/div><\/p> <p> <label> <\/label> <input type=\"button\" id=\"calculate\" value=\"Calculate\"> <\/main> <\/body> <\/html><\/p> <p> <\/p> <p>Please help. <\/p>", "transcribed_text": "", "related_book": { "title": null, "isbn": null, "edition": null, "authors": null, "cover_image": null, "uri": null, "see_more_uri": "" }, "free_related_book": { "isbn": "", "uri": "", "name": "", "edition": "" }, "question_posted": "2024-08-28 06:28:26", "see_more_questions_link": "\/study-help\/questions\/computer-science-operating-system-2022-August-09", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/study-help\/modern-mathematical-statistics-with-applications\/151-consider-an-rv-x-with-mean-m-and-standard-1989550", "description": "151. Consider an rv X with mean m and standard deviation s, and let g(X) be a specified function of X. The first-order Taylor series approximation to g(X) in the neighborhood of m is The right-hand...", "stars": 0 }, { "url": "\/study-help\/questions\/capital-budgeting-decision-since-lsus-corporation-is-producing-at-full-84312", "description": "Since LSUS corporation is producing at full capacity, Amanda has decided to have Han examine the feasibility of a new manufacturing plant. This expansion would represent a major capital outlay for...", "stars": 3 }, { "url": "\/study-help\/questions\/41-two-communicating-devices-are-using-a-single-bit-odd-10099446", "description": "4.1 Two communicating devices are using a single bit odd parity check for error detection. The transmitter sends the following 7 bits data: 1010101 1101101 1100111 1000001 1111111 Add parity-checking...", "stars": 3 }, { "url": "\/study-help\/questions\/use-linear-approximation-to-approximate-v644-as-follows-let-f-2326124", "description": "Use linear approximation to approximate v64.4 as follows. Let f(@) = Va. The equation of the tangent line to f(x) at a = 64 can be written in the form y = ma + b. Compute m and b. m b Using this find...", "stars": 3 }, { "url": "\/study-help\/questions\/qu-1-differentiate-between-treasury-bonds-and-treasury-indexed-bonds-1000401", "description": "Qu. 1 Differentiate between Treasury bonds and Treasury indexed bonds. Qu. 2 Who issues semis and what is the purpose of the funds raised? Qu. 3 Define yield to maturity. Why is it important? Qu. 4...", "stars": 3 }, { "url": "\/study-help\/questions\/hiroole-products-operates-a-small-plant-in-new-mexico-that-1011576", "description": "Hiroole Products operates a small plant in New Mexico that produces dog food in batches of 1.500 pounds. The product sells for $6 per pound. Standard costs for 2021 are: Standard direct labor cost =...", "stars": 3 }, { "url": "\/study-help\/questions\/scenario-part-1-you-are-working-at-a-busy-nightclub-4897524", "description": "Scenario (Part 1) You are working at a busy nightclub and have been monitoring a patron for the last hour. The patron has not ordered a single drink, but you have noticed significant changes in their...", "stars": 3 }, { "url": "\/study-help\/questions\/describe-a-healthcare-quality-improvement-that-occurred-within-an-organization-984715", "description": "describe a healthcare quality improvement that occurred within an organization. In this discussion, you will Examine the quality improvement that occurred, including the background and the process...", "stars": 3 }, { "url": "\/study-help\/questions\/youre-starting-a-small-photography-business-you-need-an-inexpensive-1000457", "description": "You're starting a small photography business. You need an inexpensive but powerful photo editing program to touch up your Images. Compare two photo editing programs in the $75-$200 range. Evaluate...", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/a-materials-efficiency-variance-can-be-caused-by-all-of-8562712", "next": "\/study-help\/questions\/mccann-co-has-identified-an-investment-project-with-the-following-8562714" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "debug fv.js for TWO errors; then upload only the corrected fv.js .", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/debug-fvjs-for-two-errors-then-upload-only-the-corrected-8562713" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } }