INSS 250 n-Class Exercises & Homework 1 Write programs in JavaScript to accompli
ID: 3792420 • Letter: I
Question
INSS 250 n-Class Exercises & Homework 1 Write programs in JavaScript to accomplish the following: 1. 120 points] Implement the Challenge: Loopy Ruler and Challenge: Lined Paper within the same program. Make the ruler readings to fall on drawn lines. Be certain to use loops in your solution. 2. 120 points] Using the grid generated in problem one, write your name in all capital letters in a box whose upper left corner is located at x 100, y 200 on the drawing canvas. 3. 120 points] Draw a square that has points occurring at the midpoints (or close to it) of the frame of the canvas, hint using the line function may make it easier to draw. Your final drawing will resemble the drawing below. 4. [40 points] Using the draw function make two squares of equal size that converge at the center. The squares should enter the screen from opposite sides starting at the top and travel down on a diagonal progressing toward each other at equal rates and meet in the center. Fill the square that approaches from the right top with orange, and the square approaching from the left top with blue. Change the color of the converged (combined) squares to red. Set the background color to a pale yellow. Note: make the "step size" avariable.Explanation / Answer
(1)
fill(17, 0, 255);
// a handy ruler across the top
var x = 0;
while (x<400){
text(x,x,10);
x+=50;
}
//a handy ruler across the side
var y=0;
while (y < 400){
text (y,0,y);
y+=50;
}
(2)
text("Hello!", 100, 215);
noFill();
rect(100, 200, 50, 20, 15);
(3)
line(195, 100, 300, 200);
line(100, 200, 195, 100);
line(100, 200, 195, 300);
line(195, 300, 300, 200)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.