Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for practice from an old project I couldnt figure out, please give me the code to do this so I can see where

This is for practice from an old project I couldnt figure out, please give me the code to do this so I can see where I went wrong! Thank you!Working with your partner, experiment with loops. Task 2: Create a JavaScript file
Create a new javascript file in your code editor in your lab's js folder
Put a comment block at the top of your program
Create a "FizzBuzz" function similar to how we did in class.
Loop through numbers 1 to 200, listing them as you go
If the number is a multiple of 3, if should print "Fizz!"
If the number is a multiple of 5, it should print "Buzz!"
If the number is a multiple of 7, it should print "Boom!"
If the number is a multiple of more than one 3,5 or 7, it should combine Fizz, Buzz, and Boom. For example, if the number is a multiple of 3 AND 5,
it should print "FizzBuzz!" and so on.
Make it so the output of your program appears in your output div.
One way to do this is to compile one long string as you output numbers. Something like:
oneLongString += num +" Fizz!";
Then after you've run through all the numbers, output the str at the end to your output div using:
$("#output").html(oneLongString);
Another way: For each number, create a new DOM element and append to your output div:
str += "Fizz";
$("#output").append(""+ str +"");
Don't forget to call your function.
Remember:
Use the JavaScript console to see if anything went wrong
Experiment with new commands in the JavaScript console to see how they work
Add comments to your function to say what it does
Make it neat using lots of whitespace.
Style in programming matters, so use indentations and spaces where necessary. Use the JavaScript console to see if anything went wrong
Experiment with new commands in the JavaScript console to see how they work
Add comments to your function to say what it does
Make it neat using lots of whitespace.
Style in programming matters, so use indentations and spaces where necessary.
Remember to put a semicolon at the end of every line.
Take a screenshot of your JavaScript file in your code editor.
Task 1: Create an index.html for your lab
As always, create the proper folders and an index, css, and JavaScript files for this lab. And make sure you also put a link from your art101 homepage to
this lab
Create an index.html with three organized sections: Challenge, Problems, and Results
Use heading, div, and paragraph tags to organize your page
As usual, link jQuery and a JavaScript file from the section of your HTML like this:
Add a CSS stylesheet in your css folder and link from index.html
Create an output div
image text in transcribed

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Find Ix, Iy and Iz in the network shown 12 mA - 4 mii 2 tnnA

Answered: 1 week ago

Question

c. What were the reasons for their move? Did they come voluntarily?

Answered: 1 week ago

Question

5. How do economic situations affect intergroup relations?

Answered: 1 week ago