Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Attached is what is submitted for my java script class. But my teacher wants me to resubmit because of the following problem: * move myFunction()

Attached is what is submitted for my java script class.

But my teacher wants me to resubmit because of the following problem:

 * move myFunction() to script.js files

 * rename myFunction() to reflect what function does 

* update per 10/3/22 additional notes in the assignment description

 * output the results, the odd numbers between first and the second number and their sum using alert window 

* call function on clicking submit button 

 

 

Please help me to fix the problems.

My code.png 
* remove line 56 * line 43: sum+=i; //no nee for parseInt() i is already an integer

Q https://replit.com/@F22-CS112-ONLINE-GRIGORIANTS/Lab-6-NiloufarVahid Ramezani#index.html index.html + lab #6 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 function myFunction() { let firstNum = document.getElementById("firstNum").value; let secondNum = document.getElementById("secondNum").value; if(isNaN(firstNum) || isNaN(second Num) ) { } alert("Input must be numbers"); document.getElementById("output").innerHTML = ""; else if(firstNum>second Num) { } alert("First Number cannot be greater than second number"); document.getElementById("output").innerHTML = ""; else{ let sum = 0; for (let i firstNum; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing and Assurance services an integrated approach

Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley

14th Edition

133081605, 132575957, 9780133081602, 978-0132575959

More Books

Students also viewed these Programming questions