Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I get my javascript code to work, it says Unexpected token } var img = new SimpleImage(hilton.jpg); var w = img.getWidth(); print(w); print(img);

How do I get my javascript code to work, it says Unexpected token }

var img = new SimpleImage("hilton.jpg"); var w = img.getWidth(); print(w); print(img);

for (var pixel of img.values()); } } if (pixel.getX() < img.getWidth()/3) // set pixels to red

pixel.setRed(255); pixel.setGreen(255); pixel.setBlue(255); } else if (pixel.img < img.getWidth()/ 3 && pixel.img > img.getWidth()/3*2) // set pixels to green } pixel.setGreen(255); pixel.setRed(0); pixel.setBlue(0); } else if (pixel.img > (img.getWidth()/3*2) // set pixels to Blue } pixel.setBlue(255); pixel.setRed(0); pixel.setGreen(0); } print(img); } }

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions

Question

When does a bargain purchase occur?

Answered: 1 week ago

Question

Decision Making in Groups Leadership in Meetings

Answered: 1 week ago