Here is the following code for HTML and CSS. I need you provide me the javascript code for following as I explained in d

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Here is the following code for HTML and CSS. I need you provide me the javascript code for following as I explained in d

Post by answerhappygod »

Here is the following code for HTML and CSS. I need you provide
me the javascript code for following as I explained in detail
below:
calculations.js
informal_tests.js
primes_module.js
prime_numbers.html
styles.css
calculations.js
Objectives
Here is what we'd like you take out of this assignment.
Course
Assignment
Getting Started
You should start by downloading the following
files: here (Links to an external site.). You should
create a new project and copy-paste the provided files into your
project folder. After reviewing the files you will see that you
have been provided with:
Working With Prime Numbers
If it has been a bit since you've reviewed the concept of prime
numbers, then please take a look at the following
tutorial: link (Links to an external site.). There are a
few definitions you will need to understand to complete this
assignment:
Writing the Primes Module
The goal of part #1 is to practice writing functions. To start
out you should write the following four functions inside of
the primes_module.js file.
This function accepts the components of the range [low, high] as
inputs. The function should return an array of any primes that fall
within the specified range. You should use the following strategy
when writing this method:

Create a new array to hold the prime numbers. Loop from low to high
and test each integer in the range for primality. You can test each
number using your isPrime() function in the same file. If isPrime()
returns true, then add the number to array of primes. Once the loop
completes, return the array.
This function accepts the components of the range [low, high] as
inputs. The function should return the number of primes that fall
within the specified range. You should use the following strategy
when writing this method:

Call your primesIn() function in the same file with the inputs to
this function. This will return an array of primes. Use the length
of the array to return the number of primes found in the input
range.
Testing the Primes Module
Before moving on, you should take some time to verify that the
functions in the primes module are working correctly. You should
include these tests in the informal_tests.js file. To run your
tests you will need to update the prime_numbers.html page so that
it loads both scripts (primes_module.js (first), then
informal_tests.js). You should then invoke the functions in your
module within the second file and practice calling your functions.
Each of the functions will return a result that you can view by
printing them out to the browser REPL console.
Here are some example test cases:
Note: Part of your grade in part #1 is
based on how thoroughly you test your functions. Be aware
that low effort solutions will be graded down. Here is some
example output from the test cases above printed out on the REPL
console.
Here Is The Following Code For Html And Css I Need You Provide Me The Javascript Code For Following As I Explained In D 1
Here Is The Following Code For Html And Css I Need You Provide Me The Javascript Code For Following As I Explained In D 1 (19.1 KiB) Viewed 67 times
Note: While you have been provided some
examples above, you should not just mindlessly copy these test
cases. Try some numbers of your own and see if you get the results
you expected.
What's Coming Up Next In Part #2?
In part #2 we will be adding functionality to the provided HTML
page. If you load the page initially it should look like the
following:
Here Is The Following Code For Html And Css I Need You Provide Me The Javascript Code For Following As I Explained In D 2
Here Is The Following Code For Html And Css I Need You Provide Me The Javascript Code For Following As I Explained In D 2 (27.6 KiB) Viewed 67 times
These form elements will allow users to test a number for
primality (in the upper region) or to generate primes in a range
(the lower region). In part #2 of the assignment you will use your
primes module to respond to user inputs, generate the results of
user choices, and display their results on the page. For example,
the page might look like the following:
Here Is The Following Code For Html And Css I Need You Provide Me The Javascript Code For Following As I Explained In D 3
Here Is The Following Code For Html And Css I Need You Provide Me The Javascript Code For Following As I Explained In D 3 (42.75 KiB) Viewed 67 times
7 Filter Output Is 101 prime? true Factors of 6: 6,3,2,1 Factors of 10: 10,5,2,1 Factors of 27: 27,9,3,1 Factors of 60: 60,30, 20,15,12,10,6,5,4,3,2,1 Primes in [1,20]: 2,3,5,7,11,13,17,19 Primes in [1,100]: 2,3,5,7,11,13,17,19,23,29,31, # or primes in [1,150]: 35 » |
Enter a number to analyze! Number: Analyze! Prime Status Factors Generate primes! Low: Generate! High: Primes
Enter a number to analyze! Number: 27 Analyze! Prime Status 27 is not prime Factors 27 9 3 1 9 Generate primes! Low: 1 Generate! High: 150 Primes 2 3 5 7 11 13 17 19 23 29 31 37 41 45 103 107 109 113 127 131 137 139 149
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply